bliako has asked for the wisdom of the Perl Monks concerning the following question:
or evenuse JSON::Parse; my $JP = JSON::Parse->new(); $JP->warn_only(); $JP->warn_only(1);
it gives me:JSON::Parse->warn_only($JP, 'on');
or:Usage: JSON::Parse::warn_only(parser, onoff)
EDIT: note: the following does not complain but has no effect i can notice of.JSON::Parse::warn_only: parser is not of type JSON::Parse
Below is a perl snippet to demonstrate the issue:$j->warn_only(1);
Results:use strict; use warnings; use JSON::Parse 0.38; use Data::Dumper; my $j = JSON::Parse->new(); # no complain, no effect: $j->warn_only(1); # legal json: my $pl = $j->run('{"k":"v"}'); print Dumper($pl); print "I am not dead 1\n"; # illegal json, the following statement dies: $pl = $j->run('illegal json'); print Dumper($pl); print "I am not dead 2\n";
many thanks monks.$VAR1 = { 'k' => 'v' }; I am not dead 1 JSON error at line 1, byte 1/12: blah blah blah at which point it has +died.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: JSON::Parse how to warn_only()?
by stevieb (Canon) on Jun 11, 2016 at 15:44 UTC | |
|
Re: JSON::Parse how to warn_only()?
by stevieb (Canon) on Jun 12, 2016 at 15:07 UTC | |
|
Re: JSON::Parse how to warn_only()?
by Anonymous Monk on Jun 11, 2016 at 17:42 UTC | |
by stevieb (Canon) on Jun 12, 2016 at 13:09 UTC | |
|
Re: JSON::Parse how to warn_only()?
by ikegami (Patriarch) on Jun 14, 2016 at 16:55 UTC | |
by bliako (Abbot) on Jun 18, 2016 at 14:53 UTC | |
by ikegami (Patriarch) on Jun 19, 2016 at 04:25 UTC | |
by bliako (Abbot) on Jun 24, 2016 at 12:47 UTC | |
|
Re: JSON::Parse how to warn_only()?
by stevieb (Canon) on Jun 14, 2016 at 13:41 UTC | |
by bliako (Abbot) on Jun 18, 2016 at 14:55 UTC |