in reply to Re: 5.8.8 stat and file test fails
in thread 5.8.8 stat and file test fails

$ccp_home is an absolute path and the debug line before the if -e statement does return the correct filename and path. If is use stat for $ccp_home/$new_file it says no such file or directory. If I hard code what the file name is it works fine.

I added the chomp because I was concerned the array was getting newline characters. I never get to unzipping the file.

This was working prior when I was using Net::FTP. I had to install perl 5.8.8 instead of using 5.005_03 that was already on the system. I installed 5.8.8 so I could get Net::FTPSSL installed.

Replies are listed 'Best First'.
Re^3: 5.8.8 stat and file test fails
by Anonymous Monk on Aug 19, 2008 at 08:38 UTC
    Must be a Werewolf :) Try this
    $DEBUG = 1; # if its 0, or undef, no printing printf "zip_file hex [%s]\n", unpack 'H*', "$ccp_home/$new_file" if $D +EBUG; warn "WARNING zip_file has unprintable characters\n" if "$ccp_home/$new_file" =~ /[:^print:]/; printf "zip_file [%s]\n", "$ccp_home/$new_file" if $DEBUG;
    the hex version because there might be non-printable characters in filename.

        It looks like a trailing carriage return. Rip it out this way:

        $new_file =~ tr/\r//d;

        You could get rid of every unprintable character like this:

        $new_file =~ s/[:^print:]//g;