nm, figured it out.  you can pass open a scalar like this:

open($myfile, "blah");
ParseOneItem($myfile);

and use it in the sub like this:
sub ParseOneItem()      {
        my $fh = shift();
        my $line = <$fh>;
}

=)

-- christopher

On Saturday 14 December 2002 03:10 am, christopher j bottaro wrote:
> hello,
> i want to make a sub in perl 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?  and how do i access it once in the sub?  do i
> just shift() it outta @_ into a scalar?
>
> thanks,
> christopher
> _______________________________________________
> Shell.scripting mailing list
> [EMAIL PROTECTED]
> http://moongroup.com/mailman/listinfo/shell.scripting


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

Reply via email to