note
AnomalousMonk
<blockquote><i><c>
open my $filelist, '>', $filelist
or die "Can't open $filelist: $!";
</C></I></BLOCKQUOTE>
<p>
This is simply an inadvertance, but using a new lexical <c> my $filelist </C> for the filehandle in the [doc://open] statement masks the file name in the old lexical of the same name (and also generates a warning if [doc://warnings] are enabled, which is strongly recommended). I would write something like:
</P>
<c>
>perl -wMstrict -le
"my $filelist = 'xyzzy';
open my $filehandle, '>', $filelist or die qq{opening '$filelist': $!};
print $filehandle $_ for qw(foo bar baz);
close $filehandle or die qq{closing '$filelist': $!};
"
>type xyzzy
foo
bar
baz
</C>
1022103
1022130