Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Turn off FATAL warnings in 3rd party module

by toolic (Bishop)
on Jun 03, 2019 at 14:59 UTC ( #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
Node Status?
node history
Node Type: note [id://11100875]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2020-10-19 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (205 votes). Check out past polls.

    Notices?