Hi All,

I am knocking my head against a wall trying to work with directories 
with spaces.

I need to translate some file paths like the one below:

/data/scanning/phil/edits/gary/finished/STI 9-10-06/E0102.tif

into 
/var/www/phil/pix/E0102.jpg

(I need the path to the tif to make the jpeg).

If I glob the files in the parent directory and then File::Basename I 
end up with 'STI'  as the filename and the rest of the program fails.

foreach my $d (@dirs) {
        print STDERR "reading files from $d.\n";
        my @tif = glob("$d/*tif");      
        foreach my $t (@tif) {
                my $base = basename("$t");
                (my $j = $base) =~ s/tif$/jpg/;
                print STDERR "Found $base $j $t\n";;
                push(@names,$n);
        }
}

Is there some quoting scheme I should be using? Or do I have to use a 
regex to grab the filename from the end of the string?

TIA.
Dp.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to