donkeykong has asked for the wisdom of the Perl Monks concerning the following question:
Here's the error I get:BEGIN { use strict; use File::Next; use File::Util; use File::Copy; } my ($file_util) = File::Util->new(); move_files() sub move_files { open (FILE, "<ad_archive.rtf") or die "$!\n"; while (<FILE>) { next if ($_ !~ /\w/); my ($full_path) = ($_ =~ /\d*\s(.*)/); my ($par_dir, $file_name) = ($full_path =~ /.*\\(.*)\\(.*)/); my ($file_no_ext) = ($file_name =~ /(.*)\.pdf/); my ($first_five) = ($file_no_ext =~ /(\d{5}).*/); $first_five .= 'xxx'; if ($par_dir =~ $file_no_ext) { my $directory = "\\\\filervoca\\e\$\$\\activeads\\adwatchf +olders\\$first_five\\$file_no_ext"; #print "path: $full_path\npar_dir: $par_dir\nfile_name: $f +ile_name\nfirst_five: $first_five\ndirectory: $directory\n"; #print "dir doesn't exist, need to make it\n"; $file_util->make_dir($directory, '--if-not-exists') or die + "$!"; copy($full_path, "$directory\\$file_no_ext"."00.pdf") or d +ie (print "$!"); } sleep 10; } close FILE; }
Thank you in advance for your help.<b> PROCESS TERMINATED DUE TO ERRORS File::Util can't use this string for (weird character)the name of a di +rectory1/2. (same weird character)\\filervoca\e$$\activeads\adwatchf +olders\00232xxx\00232351(1/2) It contains illegal characters. Illegal characters are: \ (backslash) / (forward slash) : (colon) | (pipe) * (asterisk) ? (question mark) " (double quote) < (less than) > (greater than) \t (tab) \ck (vertical tabulator) \r (newline CR) \n (newline LF) Origin: This is a human error. Solution: A human must remove the illegal characters from this string. ARG _pak = File::Util ARG purpose = the name of a directory ARG string = \\filervoca\e$$\activeads\adwatchfolders\00232xxx\0023235 +1 1. File::Util::_throw -called at line(1322) of blib\lib\File\Util.pm --was called with args --was not called to evaluate anything 2. File::Util::make_dir - called at line (45) of findpdfs.pl --was called with args --was not called to evaluate anything 3. main::move_files -called at line (11) of findpdfs.pl --was called with args --was not called to evaluate anything </b>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: finding odd characters in a string that I am creating in the script
by graff (Chancellor) on Jul 28, 2009 at 05:47 UTC | |
by Marshall (Canon) on Jul 28, 2009 at 09:52 UTC | |
|
Re: finding odd characters in a string that I am creating in the script
by Marshall (Canon) on Jul 28, 2009 at 04:36 UTC | |
|
Re: finding odd characters in a string that I am creating in the script
by Anonymous Monk on Jul 28, 2009 at 04:07 UTC | |
by donkeykong (Novice) on Jul 28, 2009 at 04:11 UTC | |
|
Re: finding odd characters in a string that I am creating in the script
by ikegami (Patriarch) on Jul 28, 2009 at 14:08 UTC |