You can just open with an undefined scalar and use the scalar the same way you would the filehandle.
open my $foo, '<', 'data.txt' or die "Can't read data.txt: $!"; while ( <$foo> ) { chomp; #etc. } close $foo;
The resulting scalar can be passed around to other functions and used there.
In reply to Re: Still blurry on variables for filehandles
by kyle
in thread Still blurry on variables for filehandles
by throop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |