in reply to Re^3: Generate Array of Hashes WITHOUT References
in thread Generate Array of Hashes WITHOUT References

Well explained, AF. Thanks for that!

I tried $Data::Dumper::Deepcopy = 1;, and I see what you mean. One thing I don't understand is what you mean by:
  see by for { ... } print Dumper( \%rec ) ;
I'd like to try that code, but what exactly should I type, coz the syntax doesn't look right yet?

Replies are listed 'Best First'.
Re^5: Generate Array of Hashes WITHOUT References
by Anonymous Monk on Sep 11, 2014 at 07:11 UTC

    To start ...

    • ... means fill in the code as appropriate (and, author was too lazy to provide the whole thing not directly related to the point);
    • for { ... } is a reference to for loop code inside while loop;
    • then, print statement would go right after for loop.

    ... so  for { ... } print Dumper( \%rec ) ; expands to ...

    ... while ( <DATA> ) { ... for $field ( split ) { ... } print Dumper( \%rec ) ; push @AoH, \%rec; } ...