Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Recreating hash

by GrandFather (Cardinal)
on Sep 12, 2012 at 01:59 UTC ( #993118=note: print w/ replies, xml ) Need Help??


in reply to Recreating hash

The data you show has an error in it. There should be a ' following "(UTC)".

Assuming the code shown in the OP with the syntax error corrected:

my %hash = %$VAR1; print "At $hash{alerts}[0]{timestamp}: $hash{alerts}[0]{text}\n";

Prints:

At 1347395226: 95.019 (value) > 95 (max limit) between Tue 20:19 - +Tue 20:20 (UTC)

If that's not the help you wanted you'll need to be more explicit.

True laziness is hard work


Comment on Re: Recreating hash
Select or Download Code
Re^2: Recreating hash
by kitkit201 (Initiate) on Sep 12, 2012 at 02:10 UTC
    Whops on the syntax error.. Thanks for your quick reply GF. I got the second part of my answer and now looking for the first part. Since this is the output of the hash, how would you recreate this hash from scratch in a perl program (with the same elements and what not)? I'm having trouble with the elements and the double references of => into =>.

      I don't understand "how to create it in the perl code" given that what you show is Perl code. What are you actually having trouble with? Maybe you should give us some context so we understand where you are coming from?

      True laziness is hard work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993118]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-10-25 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (139 votes), past polls