And this works 'as expected', I think...
use strict; use warnings; open my $in, '<', "a"; print firstline("b"); sub firstline { my $retval = open (my $in, shift); $retval && return scalar <$in>; # no close() required }
--MidLifeXis
In reply to Re^2: what is the return value
by MidLifeXis
in thread what is the return value
by arasumg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |