Set a flag when the condition occurs and check for it.
our $SKIP_REST_OF_FILE; sub trap_substr_warning { my $e = $@; if ( $e =~ /whatever/ ) { $SKIP_REST_OF_WARNING = 1; } else { print STDERR $e; } } sub find_process { local $SKIP_REST_OF_FILE = 0; local $SIG{__WARN__} = \ &trap_substr_warning; ... if ( $SKIP_REST_OF_FILE ) { ... } }
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re: Advanced warning handling?
by diotalevi
in thread Advanced warning handling?
by eff_i_g
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |