Perhaps file or directory permissions related to the file being checked based on the user running the perl script?

Jim

On 9/25/2013 4:07 PM, Peter Ezetta wrote:
Hi Renato,

Welcome to Perl and to the list!

I took a quick run through your code, and it's working fine for me.

Are you calling it with "perl script.pl <filename>"?  The behavior you
describe almost sounds like you are not providing the argument when you
call the script.

Hope this was helpful!

Peter

On Sep 25, 2013, at 12:38 PM, RENATO AUGUSTO CORREA DOS SANTOS
<rcs.un...@ig.com.br <mailto:rcs.un...@ig.com.br>> wrote:

Hi, all.

I am a very begginer in PERL starting today in this mailing list! :-)
I will try to work especially with Bioinformatics.

I am trying to verify the existence of a file in PERL; however, is
seems not to work. It always returns "The file $file_seqs does not
exist!!!".

Do you know where I am making a mistake?

<code>
#!/usr/bin/perl

use strict;

my $file_seqs;

$file_seqs = $ARGV[0];

        if (!-e $file_seqs)     {
        print "The file $file_seqs does not exist!!! \n";
        exit(0);
        }
        else    {
        print "The file $file_seqs exist!!! \n";
        }
</code>

--
*Renato Augusto CorrĂȘa dos Santos (Undergraduate Researcher)*
Bioethanol Science and Technology Laboratory (ABTLuS-CNPEM)
+55 19 9722 5665


------------------------------------------------------------------------
Confidentiality Notice: This e-mail may contain proprietary information
some of which may be legally privileged. It is for the intended
recipient(s) only. If you believe that it has been sent to you in error,
please notify the sender by reply e-mail and delete the message. Any
disclosure, copying, distribution or use of this information by someone
other than the intended recipient(s) is prohibited and may be unlawful.


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