Begin forwarded message:
From: Mike Lesser <[EMAIL PROTECTED]>
Date: June 3, 2007 3:48:56 PM EDT
To: "Chas Owens" <[EMAIL PROTECTED]>
Subject: Re: Paths, Spaces, Getopt::Long
On Jun 3, 2007, at 1:59 PM, Chas Owens wrote:
On 6/3/07, Mike Lesser <[EMAIL PROTECTED]> wrote:
snip
I have to assume that paths can be converted easily for use in shells
and such, without resorting to RegEx. Any ideas?
snip
Aside from the multi argument version of system that Tom has already
mentioned, the bigger question is "Why are you running code outside of
Perl?" Often people think they need to say things like
The script needs to use tidy to strip garbage from an html file prior
to reading it. It's a file automatically generated by another company
and it's filled with junk, hence no chance to fix it at the source.
The HTML::Tidy module would be fine but it doesn't pass testing on my
box, and won't work with a forced install. I took a look and found
that that seems to be a recurring problem on OS X 10.4. I haven't yet
looked thru the code to determine the source of the problem as it
seemed that running either Shell or system () was an interesting
thing to learn. I might have been wrong there!
I've had success running hard coded paths and stuff, but now see that
there's this space problem, which I didn't realize since Perl was
handling paths nicely all by itself!
system "rm -rf $path";
system "mkdir $path";
system "chmod 666 $path";
when they could just as easily say
use File::Path;
use File::chmod;
rmtree $path;
mkpath $path;
chmod 0666, $path;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/