in reply to Re: what is the return value
in thread what is the return value
prints:#!/usr/bin/perl use strict; use warnings; use 5.016; # Modified from parent and MidLifeXis' 1043331 open my $in, '<', "a.txt"; print firstline("b.txt"); sub firstline { say "at_: @_"; my $file = shift; my $retval = open (my $FH, '<', $file ); $retval && return scalar <$FH>; # no close() required }
at_: b.txt from b
|
|---|