Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: JSON Formatted String

by ikegami (Patriarch)
on Jan 13, 2011 at 06:11 UTC ( [id://882034]=note: print w/replies, xml ) Need Help??


in reply to Re^2: JSON Formatted String
in thread JSON Formatted String

Before I pass the string to that function, I want to verify whether the received string is in correct JSON format

I know that I can catch the error in particular function can be caught by using $@ variable

I'm confused. You've just answered your own question.

my $valid = eval { $json->decode($input); 1 };

Replies are listed 'Best First'.
Re^4: JSON Formatted String
by nvivek (Vicar) on Jan 13, 2011 at 06:56 UTC

    Thanks a lot. It is working for me.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found