Just use a do{print and return} block vis:
sub test { $arg = shift; do{ print "Did preturn!\n"; return } if $arg; print "Did not print and return!\n"; } test(0); test(1);
You can even do this but you need to watch precedence.
sub test { $arg = shift; print "Did preturn!\n" and return if $arg; print "Did not print and return!\n"; } test(0); test(1);
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: print and return...
by tachyon
in thread print and return...
by suaveant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |