CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
what kind of data structure is this ?

 



ravikim
New User

Jan 4, 2010, 1:30 AM

Post #1 of 3 (390 views)
what kind of data structure is this ? Can't Post

I have a the following code snippet :

foreach my $table (keys %config::db_columns)
{
my $select_stmt = 'select ' . lc(join(',', @{$config::db_columns{$table}}));

$select_stmt .= " from $table";
if ($table eq 'employeeview') { $select_stmt .= ' where present=1'; }

my %db_data = undef;
$sth = $dbh->prepare("$select_stmt");
if ($sth->execute)
{
my $n = 0;
while (my $hashref = $sth->fetchrow_hashref)
{
foreach my $column (@{$config::db_columns{$table}})
{
$db_data{$table}[$n]{$column} = $$hashref{$column};
}
$n++;
}
}
}
print "Database upload completed.\n";

could some tell me what kind of datastucture is $db_data{$table}[$n]{$column} ?

and some insight of what does the developer intend to do ?


shawnhcorey
Enthusiast


Jan 4, 2010, 8:01 AM

Post #2 of 3 (385 views)
Re: [ravikim] what kind of data structure is this ? [In reply to] Can't Post

You can view a complex data structure via Data::Dumper. See `perldoc Data::Dumper`.

__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


ravikim
New User

Jan 5, 2010, 2:52 AM

Post #3 of 3 (379 views)
Re: [shawnhcorey] what kind of data structure is this ? [In reply to] Can't Post

thanks for your reply...

also i have found that it is an hash of array of hashes

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives