in reply to print and return...
I would do this, if I should need it once:
do{print, return $_ for "1\nError was $foo\n"} if $foo;
If I would need it often, I would make a function:
sub teeprint { print, return $_ for @_ }
... and call it like this:
return teeprint "1\nError was $foo\n" if $foo;
Update:Um, reading Chemboy's response,
I note I may have misunderstood the question.
("Good
answer, Sidhekin -- too bad it was not an answer to
suaveant's question.")
If you want to just return false, my choice of idiom
would be
print("1\nError was $foo\n"), return if $foo;
The Sidhekin
|
|---|