esharris has asked for the wisdom of the Perl Monks concerning the following question:
If LIST is empty and $@ already contains a value (typically from a previous eval) that value is used after appending "\t...caught" to $@. This is useful for staying almost, but not entirely similar to die.
If $@ is empty then the string "Warning: Something's wrong" is used.
The following code ...
... gives the following output.#!/usr/bin/perl -w warn; $@ = 'Huh?'; warn; warn '';
I didn't expect the last line, because the LIST is NOT empty; it has an empty string. Is ('') considered an empty list or is the documentation unclear?Warning: something's wrong at ./temp4.pl line 2. Huh? ...caught at ./temp4.pl line 5. Huh? ...caught ...caught at ./temp4.pl line 6.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: warn documentation unclear
by diotalevi (Canon) on Dec 08, 2005 at 03:06 UTC | |
|
Re: warn documentation unclear
by TedYoung (Deacon) on Dec 08, 2005 at 15:37 UTC | |
|
Re: warn documentation unclear
by TedYoung (Deacon) on Dec 08, 2005 at 15:37 UTC |