On Fri, Oct 17, 2003 at 12:38:33PM -0500, Daniel Staal wrote:
> I need to open a filehandle in one sub, use it in several 
> others, and then close it in a different sub yet.  I'd pass it as a 
> parameter, but all the subs are actually called by XML::Parser, so I 
> don't get to choose the parameter list.

You could use a lexically-scoped filehandle.

  {
     my $fh;

     sub do_open   { open $fh  .... }
     sub do_append { print $fh .... }
     sub do_close  { close $fh .... }
  }

-- 
Steve

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

Reply via email to