In this snippet exit doesnt end the perl cgi script as i expect it to do but instead it exits the if structure.
There's no such thing as exiting an if structure with exit. You can exit a loop with last, but exit exits the program.
if(1) { print "1 seems to be true\n"; exit 0; } print "After exit..\n"; __END__ 1 seems to be true
The After exit. is not printed.
Wouldnt it be better to just somethign like this work?
No, because die throws its message out STDERR, which is not what you want. Read the docs.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re^3: Merge 2 lines in 1 die statement
by shmem
in thread Die statement with text & formatting of the user
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |