Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Turn off FATAL warnings in 3rd party module

by toolic (Bishop)
on Jun 03, 2019 at 14:59 UTC ( [id://11100875]=note: print w/replies, xml ) Need Help??


in reply to Turn off FATAL warnings in 3rd party module

I don't know if you can disable the warning without modifying the source code, but one way to capture the warning is to use eval
use strict; use warnings; use Tree; my ($i, $T, $n); $T = Tree->new('root'); my $t = $T; for($i=0;$i<100;$i++){ $n = Tree->new("child $i"); eval { $t->add_child({}, $n); }; if ($@) { # take some action... } $t = $n; } print "success\n";

Then you can decide what action to take.

My guess is that the NONFATAL attempt did not work because it is in the wrong scope; NONFATAL would have to be used inside the Tree module.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-19 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found