On 3/22/2012 3:47 PM, Manfred Lotz wrote:
Hi all,
If I run the following small test snippet
<--------------------------------------snip------------>
#! /usr/bin/perl
use strict;
use warnings;
use autodie;
open my $hdl, ">", "fileio1.txt";
print $hdl "a line\n";
close $hdl;
open HDL, ">", "fileio2.txt";
print HDL "a line\n";
close HDL;
<--------------------------------------snap------------>
I get the message:
Name "main::HDL" used only once: possible typo at ./fileio1.pl line 16.
Why? The same as with $hdl above I use HDL three times.
You can't use "typeglob" style filehandles with autodie -- it only
works with lexical filehandles (one reason that the latter are now
preferred). See the Bugs section of "perldoc autodie".
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/