Hi Robert,

I am sorry for the typos in the mail.. Actually the file is tar.gz only, Tar.gz 
was a typo, and secondly the error message was still showing as <file>.tar.gz 
does not exist but again it was a mistake from my end. 

Actually your response helped me get the solution. I figured out that we were 
using an older version 5.004 on sun os, sun4x_55. I tried the same script using 
perl5.87 (latest version we had) and it worked!!

Thanks a lot for your help.

Regards,
Anu.




________________________________
From: Robert Citek <rwci...@alum.calberkeley.org>
To: Perl Beginners <beginners@perl.org>
Cc: Anu P <anurao_...@yahoo.com>; John Refior <jref...@gmail.com>
Sent: Thursday, July 9, 2009 7:40:00 AM
Subject: Re: Help needed with '-e' operator

On Wed, Jul 8, 2009 at 6:57 PM, John Refior<jref...@gmail.com> wrote:
> On Wed, Jul 8, 2009 at 7:34 AM, Anu P <anurao_...@yahoo.com> wrote:
>
>> I am trying to use the '-e' filetest operator and encountered some wired
>> behavior.
>> I have a tar.gz file which is around 2.6 G and this is the code...Tar.gz
>> file is in the same directory where script is executed.
>>
>> unless (-e $file) {
>> print ("ERROR: $file does not exist\n");
>> exit(1);
>> }
>>
>> This does not seem to work..I always get "File does not exist" message.
>> I also tried out with a small tar.gz file which is around 2K and that seems
>> to work. so I am not sure if the usage of '-e' operator has limitation with
>> file size.
>
> It's a long shot, but I notice that you say "tar.gz" in one place, and
> "Tar.gz" in another place.  Maybe that's intended as a new sentence, and
> that's why it's capitalized, I'm not sure with the three-dot ellipsis there.
>  The point is: make sure you have the right case.  "tar.gz" is not "Tar.gz".

Good point.  And also notice that the error message that you are
getting "File does not exist" is not the same as what is supposed to
print, "ERROR: foo.tar.gz does not exist", if $file="foo.tar.gz".

Good luck and do let the list know what you discover.

Regards,
- Robert

-- 
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