in reply to passing file handle to functions
You probably just need to pass a reference to the array into the function:
your_function(\@lis_array);
But if you really want to pass a file handle around then create a lexical filehandle and use that:
open my $kerlis, '<', $lis_file or die $!; your_function($kerlis); sub your_function { my $fh = shift; while (<$fh>) { # do something } }
People will recommend passing the typeglob into the function, but in my opinion that's a confusing hack that is no longer necessary with modern versions of Perl.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|