Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: JSON::Parse how to warn_only()?

by ikegami (Patriarch)
on Jun 14, 2016 at 16:55 UTC ( [id://1165621]=note: print w/replies, xml ) Need Help??


in reply to JSON::Parse how to warn_only()?

You are getting the following error message:

Usage: JSON::Parse::warn_only(parser, onoff)

It indicates that you need to use the following syntax:

my $jp = JSON::Parse->new(); JSON::Parse::warn_only($jp, 1);

The above simplifies to the following:

my $jp = JSON::Parse->new(); $jp->warn_only(1);

To parse the JSON, you need to use that $jp object, so you can't parse_json. You need to use run instead.

my $data = $jp->run($json);

That's why warn_only is documented as a method that can be used to modify run.

Replies are listed 'Best First'.
Re^2: JSON::Parse how to warn_only()?
by bliako (Monsignor) on Jun 18, 2016 at 14:53 UTC
    I have done all these you describe. thanks, bliako
      You are using 0.40, but warn_only was only implemented in 0.41.

        I hope I am not seen as trying to be or indeed being pedantic but the documentation of the JSON::Parse version I was using (0.40) (and before my question, it was the latest at CPAN) stated thus:

        warn_only ... This method was added in version 0.38.

        (along similar lines the comment by stevieb earlier)

        Now, after stevieb had placed a ticket, the latest version is 0.41, apparently the issue has been fixed and the relevant documentation states thus:

        This method was documented in version 0.38, but only implemented in ve +rsion 0.41.

        MANY THANKS to the author of JSON::Parse (Ben Bullock) for providing the module and fixing this minor but irritating issue in speedy fashion.

        bliako

Log In?
Username:
Password:

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

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

    No recent polls found