And if you need to revert back to previous positions in the file make use of the tell and seek functions.## bareword open open(FH, "yourfile") or die("oops - $!"); func_call( *FH ); ## variable open open(my $fh, "yourfile") or die("oops - $!"); func_call( $fh ); sub func_call { my $fh = shift; do_stuff($_) while <$fh>; }
_________
broquaint
In reply to Re: Passing filehandle to sub
by broquaint
in thread Passing filehandle to sub
by marctwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |