Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2022-08-18 19:33 GMT
Find Nodes?
    Voting Booth?

    No recent polls found