Hi all,
Firstly, this a great list. Thanks to those responsible for coming up
with it and supporting it.
I'm writing some subroutines that will require a filehandle to be passed
in. I've been looking at a FAQ on perl.com
(http://www.perl.com/pub/doc/FAQs/FAQ/oldfaq-html/Q5.25.html), which
suggested the two following options:
CODE 3:
printit(*Some_Handle);
sub printit {
my $fh = shift;
while (<$fh>) {
print;
}
}
CODE 4:
printit(\*Some_Handle);
sub printit {
my $fh = shift;
while (<$fh>) {
print;
}
}
Is one better/safer/more robust than the other? My gut feeling is to go
for the latter but I'm not really sure why.
Cheers
Mike