in reply to Re: what is the return value
in thread what is the return value
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
|
|---|