I put a print statement, just before the (-e $filename) line, to print the
$filename. It printed the $filename successfully and didn't give the
'uninitialized' warning for the print line.

----- Original Message -----
From: "Nikola Janceski" <[EMAIL PROTECTED]>
To: "'Agustin Rivera'" <[EMAIL PROTECTED]>; "Ahmed Moustafa"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 10:19 AM
Subject: RE: (-e $filename) gives Use of uninitialized value at...


> Assuming you have all warnings on, via -w or use warnings, I don't think
> $filename is losing scope, unless he uses it else where.
>
> The warning is good, it's telling  you that $filename = "" at that point
in
> your script. So either you lost the contents of $filename somewhere, or
lost
> scope of the $filename with content you wanted, or you reassigned it to
"".
> Either way you shouldn't be doing (-e ""); which is happening at that
point.
>
> > -----Original Message-----
> > From: Agustin Rivera [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 10, 2002 1:12 PM
> > To: Ahmed Moustafa; [EMAIL PROTECTED]
> > Subject: Re: (-e $filename) gives Use of uninitialized value at...
> >
> >
> > Seems like the method you use to assign filename doesn't always occur.
> > Maybe you have the my $filename='whatever' in an if statement?
> >
> > Agustin Rivera
> > Webmaster, Pollstar.com
> > http://www.pollstar.com
> >
> >
> >
> > ----- Original Message -----
> > From: "Ahmed Moustafa" <[EMAIL PROTECTED]>
> > To: "Perl" <[EMAIL PROTECTED]>
> > Sent: Wednesday, April 10, 2002 10:02 AM
> > Subject: (-e $filename) gives Use of uninitialized value at...
> >
> >
> > > I'm using (-e $filename) to check the existence of
> > $filename. If the file
> > > exists, it returns true, otherwise it gives 'Use of
> > uninitialized value
> > > at...line #' (# is the line number of the if statement -if
> > ($filename)-.
> > Why
> > > does that happen and how I can fix it, please?
> > >
> > > Thanks in advance.
> > >
> > > --Ahmed


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to