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!

 .robin.

Reply via email to