http://www.perlmonks.org?node_id=992842


in reply to Perl 5.8 to 5.16 and HASH error

foreach $key (keys %{$Xml->{data}}){ ... }

In the quoted code,  $Xml is used as a hash reference. Further in your post, you say

$Xml->[data] contains a number of xml tags and data values.
Note the difference: curly versus square braces. (I am assuming you meant to write  $Xml->[data] in a code block because as it stands, it renders as a dead  <a> link.)

So which is it: a hash reference (curly braces) ofor an array reference (square braces)?

Replies are listed 'Best First'.
Re^2: Perl 5.8 to 5.16 and HASH error
by robsgoingmad (Initiate) on Sep 12, 2012 at 08:13 UTC

    Hi

    Below is the data from $Xml using Dumper. I am not expecting to change any code. Code has moved from an old server to new server. Only differences are Linux version has changed from 2.6.24 to 2.6.18 and perl version has changed from 5.8.8 to 5.16.0

    At this point I am expecting all the code to remain as it is. It has been working for years. If you advise that "things have changed" then I will need to reconsider.

    I tried the code change you suggested and received a 500 Internal Server Error. Hope the above information helps

    Regards

    Rob