Christopher J Bottaro wrote:
> 
> hello,

Hello,

> i want to make a sub that is to be used like this:
> my @array;
> open(INFILE, "blah");
> ParseOneItem (INFILE, \@array);
> 
> i know how to pass the array reference, but how do i pass the file handle?
> can i do it just like that?

If you have Perl version 5.6 or newer then you can do this:

my @array;
open my $infile, 'blah' or die $!;
ParseOneItem( $infile, \@array );


perldoc -q "How do I pass filehandles between subroutines"



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to