Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: Using eval, but always undef?

by ultranerds (Friar)
on Mar 01, 2012 at 17:53 UTC ( #957281=note: print w/replies, xml ) Need Help??

in reply to Re: Using eval, but always undef?
in thread Using eval, but always undef?

Mmm ok, I was hoping it was simpler than that. Maybe I'll just do:

$test =~ /\Q"type":"ServiceException",/

...on the XML string, so I can see if it is as "bad" file :)

Thanks for the replies though.



Replies are listed 'Best First'.
Re^3: Using eval, but always undef?
by Your Mother (Chancellor) on Mar 01, 2012 at 17:59 UTC

    It is simple (JSON).

    use JSON; my $json_string = q|{ "error":{ "type":"ServiceException", "code":108, "message":"(#108) No results founds" } }|; my $perl_ref = decode_json($json_string); print $perl_ref->{error}{type}, $/; __END__ ServiceException

    Don't fudge it. Use the right tools. Everything else is false economy.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2016-10-22 03:55 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.