Here is your code fixed upGlobal symbol "@person" requires explicit package name at foo.pl line +18. Global symbol "@person" requires explicit package name at foo.pl line +19. Global symbol "%sentences" requires explicit package name at foo.pl li +ne 22. Execution of foo.pl aborted due to compilation errors.
Tutorials: Getting Started with Perl: Data Types and Variablesuse strict; use warnings; my %people; my @sentences = ("here i am","i am me"); $people{me}[0] = 0; $people{me}[1] = "1985"; $people{me}[2] = \@sentences; @sentences = ("there she is"); $people{friend}[0] = 1; $people{friend}[1] = "1984"; $people{friend}[2] = \@sentences; foreach my $person ( values %people) { my $rowId = $$person[0]; my $dob = $$person[1]; my @says = @{$person[2]}; addDOBToDatabase($rowId, $dob); foreach my $sentence ( @says ) { addSentenceToDatabase($rowId, $sentence); } }
In reply to Re: Help with Hash or Arrays
by Anonymous Monk
in thread Help with Hash or Arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |