You might also try using File::IO and then store the object reference in
your package ( OO parlance ON: class property) variable.

-Noah

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> On Behalf Of Greg London
> Sent: Sunday, November 18, 2001 4:33 AM
> To: [EMAIL PROTECTED]
> Subject: [Boston.pm] [Fwd: our variable angle operator]
> 
> 
> hey, the first version works fine,
> the second version dies a miserable death.
> wassup?????
> 
> is there anyway to store a file handle in a
> package variable?
> 
> Greg
> 
> 
> # version 1
>  open ( my $my_var, 'junk.pl') or die "OPEN\n";
> while (<$my_var>)
> {
>   my $line = $_;
>   print $_;
> }
> close($my_var);
> 
> 
> # version 2
> our $our_var;
> open ( $our_var, 'junk.pl') or die "OPEN\n";
> while (<$our_var>)
> {
>   my $line = $_;
>   print $_;
> }
> close($our_var);
> 

Reply via email to