27 users online (1 members and 26 guests)  


  Results 1 to 3 of 3

Related

  1. Problem with excel file writing using PERL    Forum: CGI Perl Forum
    Replies: 0
  2. problem with excel file reading in Perl-Cgi    Forum: CGI Perl Forum
    Replies: 3
  3. Running a batch script file from Perl CGI    Forum: CGI Perl Forum
    Replies: 0
  4. Replies: 1
  1. #1
    sandhya's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2006
    Posts
    3

    How to check File is Valid or Not in PERL?

    Hi ,

    In one perl application ,
    I uploading file thru HTML form and checking that file in perl is valid i.e it is existed or not in PERL like ..
    if(-e $fileName){ print "exists" } else { print "not valid" return -1;}
    but It is not checking the file..
    How can I check that file is valid or not ?

    Thanks,

  2. #2
    Yash's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2006
    Posts
    1

    Re: How to check File is Valid or Not in PERL?

    Hi Sandhya
    It should work. Are you UNIX server?.Either you can try Perl built in module.

    Like File::Finder

    Thx
    Yash
    Last edited by HTML; 03-15-2009 at 10:16 PM.

  3. #3
    pageBuzz.com's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    21

    Re: How to check File is Valid or Not in PERL?

    Are you trying to validate the data in the file or just determine if the file exists.

    If you want to validate data then it is going to depend on the data in the file.

    To validate the file you can use what you have;

    if (-e $pathtofile){}
    else {exit;}

    if you want to validate data you will need to open the file and parse the data for validation.



Tags for this Thread