in reply to Hash of arrays.. can't shift on derefferenced array

Try pushing the values onto your array:

my @data; foreach $head (keys %hoa) { push @data, $hoa{$head}; $item = shift(@data); print OUTFILE "$item"; print OUTFILE ","; }

For your specific example, this would work just as well:

print OUTFILE join ',' values %hoa;
If you really want to do what you're trying to show (creating an array with one item and then removing that item), you would have to:
foreach $head (keys %hoa) { my @data = ( $hoa{$head} ); $item = shift(@data); print OUTFILE "$item"; print OUTFILE ","; }

Update: I just realized what you were trying to do :) I'm assuming %hoa is actually a hash of arrayrefs, right? I'm guessing that something is actually going on with the construction of your HoA such that your hash entries are actually pointing at undef instead of the arrayrefs you are expecting. Try using Data::Dumper to dump out %hoa before you try to access its content. Can you post the code that you are using to build %hoa?

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'