Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Perl 5.8 to 5.16 and HASH error

by AnomalousMonk (Chancellor)
on Sep 10, 2012 at 20:03 UTC ( #992842=note: print w/replies, xml ) Need Help??

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


    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



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992842]
and a log crumbles through the grate...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2018-06-22 15:02 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.