Help for this page

Select Code to Download


  1. or download this
    $SIG{__WARN__} = sub {
        my $w = shift;
        warn $w unless $w =~ /::[ab]" used only once:/;
    };
    
  2. or download this
    my $orig_warn = $SIG{__WARN__};
    $SIG{__WARN__} = $orig_warn
        ? sub { my $w = shift; $orig_warn->($w) if $w !~ /::[ab]" used onl
    +y once/ }
        : sub { my $w = shift; warn $w if $w !~ /::[ab]" used only once/ }
    +;
    
  3. or download this
    my $abwarn = $SIG{__WARN__} // sub { warn shift };
    $SIG{__WARN__} = sub {
        my $w = shift;
        $abwarn->($w) if $w !~ /::[ab]" used only once:/;
    };