develooper Front page | perl.beginners | Postings from February 2002

file names with spaces in perl

Thread Next
Johnson, Shaunn
February 27, 2002 08:03
file names with spaces in perl
Message ID:

I'm having a problem with trying to get
a list of files with spaces in them.

I'm writing a perl script that goes into
a directory, get a list of files with spaces
in them (this is a file.doc) and run a
mkisofs command against it.

I can get a list of the files:


foreach $cmd (`ls -1 $report_dir`)


This *looks* like it gives me what i want (a list
of directories that have spaces in them, but
when i try something like this:


        $mkisofs -f -J -r -hide-joliet-trans-tbl -V 'Report' -T -v -o
'$iso_dir/$cmd.iso' "$report_dir";

I get more errors that look like this:


/usr/bin/mkisofs: No such file or directory. Invalid node -
+ /usr/bin/mkisofs -f -J -r -hide-joliet-trans-tbl -V Reports -T -v -o
/s/Profiling2/iso/03/JACKSON.iso /s/Profiling2/report/03/JACKSON


The first part (No such file or directory) I
believe is about the <file.iso> not being comleted.  
The full name of the file is still chopped up and give 
me errors.

My question: How can I capture the ENTIRE file / directory 
name and use that variable when I execute my commands?

(Sorry this seems to be a long email)



Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About