http://qs321.pair.com?node_id=420753


in reply to calling sub and returning value from the same line

How about this, instead?

sub error { warn map { "$_\n" } @_; return undef; } # # and later # open FH, ">$_[0]" or return error($!, "not able to write to file $_[0]");