At Thu, 1 Feb 2001 10:52:25 +0000, Robin Houston <[EMAIL PROTECTED]> 
wrote:
> On Thu, Feb 01, 2001 at 05:01:37AM -0500, Dave Cross wrote:
> > 
> > Within the script, the lines output to different files depending on
> > a $type data field. The files are used like this:
> > 
> > my $fh = "FH$type";
> > open $fh, ">&=$streamnum{$type}" or die $!;
> > print $fh "some data from the input file";
> > 
> > Where %streamnum maps a $type to an output file descriptor.
> > 
> > This, of course, breaks under 'use strict' [...]
> 
> If you have perl 5.6, you can do it even more simply
> (and in a way which works under 'strict'):
> 
> 
>       open my $fh, ">&=$streamnum{$type}" or die $!;
>       print $fh "some data from the input file"; 
> 
> 
> I like that!

Yeah that would be cool, but we're using 5.005_02 here :(

I've fixed it anyway. For the '&=FD' sybtax to work, you need to have
redirected that file descriptor to a file, which I was doing in the 
full script, but not in my cut-down testbed.

D'oh!

Dave...

Reply via email to