in reply to Getting a hash from a file
You're being bitten by scoping. Try it this way.
C:\test>type fileWithHash.pl ( fred=>1, bill=>2, Joe=>3, jack=>4 ); C:\test>perl -MData::Dump=pp -Mstrict -wle"my %hash = do 'fileWithHash.pl'; pp\%hash" { Joe => 3, bill => 2, fred => 1, jack => 4 }
|
|---|