Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^3: JSON Formatted String

by ikegami (Pope)
on Jan 13, 2011 at 06:11 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2020-08-13 07:53 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (69 votes). Check out past polls.