Anarion has asked for the wisdom of the Perl Monks concerning the following question:
Useless use of a variable in void context
lorien:~$ perl -wle '$SIG{__WARN__}=sub{print"TRAPED"};s///' TRAPED TRAPED lorien:~$ perl -wle '$SIG{__WARN__}=sub{print"TRAPED"};$.,$.=0' Useless use of a variable in void context at -e line 1. lorien:~$ perl -wle 'BEGIN{$SIG{__WARN__}=sub{print"TRAPED"};}$.,$.=0 +' TRAPED
Any idea of why that happens and how to catch it without a BEGIN block?lorien:~$ perl -wle '$SIG{__WARN__}=sub{print"TRAPED"};eval q{$.,$.=0 +;}' lorien:~$ lorien:~$ perl -wle '$SIG{__WARN__}=sub{print"TRAPED"};eval {$.,$.=0; +}' Useless use of a variable in void context at -e line 1. lorien:~$
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: catching warnings
by jsprat (Curate) on Apr 26, 2002 at 01:59 UTC | |
|
Re: catching warnings
by Fletch (Bishop) on Apr 26, 2002 at 01:51 UTC | |
by Anarion (Hermit) on Apr 26, 2002 at 10:00 UTC |