natxo has asked for the wisdom of the Perl Monks concerning the following question:
I have this code working on perl 5.18 but when using 5.10 I get the error on the title:
Apparently according to this Stackoverflow post http://stackoverflow.com/questions/20824920/perl-array-references-and-avoiding-type-of-arg-1-to-keys-must-be-hash-error this is something new since 5.14.my $data_ref = []; while (<$fh>) { chomp; my %temp = /($keys): (.+)/g; if (/^\s+Description:\s+(.+)\z/sm) { $temp{Description} = $1; } push $data_ref, \%temp; }
How can I solve this for 5.10? I cannot upgrade that Perl version just yet. Thanks for your help!
Back to
Seekers of Perl Wisdom