On Thu, 22 Mar 2012 15:06:35 -0500
Chris Stinemetz <chrisstinem...@gmail.com> wrote:

> On Thu, Mar 22, 2012 at 2:47 PM, Manfred Lotz <manfred.l...@arcor.de>
> 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.
> >
> 
> It looks like you are tyring to open two different filehandles. You
> need to delcare HDL.
> open my $HDL, '>', "fileio2.txt";
> 

No, I used HDL as a barename deliberately. HDL and $hdl are two
different beasts.


-- 
Manfred



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to