I have this code working on perl 5.18 but when using 5.10 I get the error on the title:
my $data_ref = [];
while (<$fh>) {
chomp;
my %temp = /($keys): (.+)/g;
if (/^\s+Description:\s+(.+)\z/sm) {
$temp{Description} = $1;
}
push $data_ref, \%temp;
}
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.
How can I solve this for 5.10? I cannot upgrade that Perl version just yet.
Thanks for your help!