decode_json() terminates my program when the argument is not valid json. How can I keep my program running and handle the error?
Example:
#!/usr/bin/perl -w
use strict;
use JSON;
my $json='<html></html>';
my $ticker=decode_json($json);
print $json;
The last print shall be executed.