note
Eimi Metamorphoumai
Are you sure you're actually getting the result you think you're getting? Specifically, it really sounds like the line number should correspond to your <c>print "$item";</c> line. And "Use of uninitialized value in string at..." is a warning, not an error (unless you're doing something strange). I'd suggest that you look at what exactly is in your hoa before the loop. Here's test code that works just fine.
<code>
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my %hoa = (
a => ["apple", "aardvark"],
b => ["banana", "bandana"],
);
foreach my $head (keys %hoa) {
my @data = @{$hoa{$head}};
my $item = shift(@data);
print "$item,";
}
print $/;
</code>
which produces as output
<code>
apple,banana,
</code>
607034
607034