On 4/30/10 Fri Apr 30, 2010 9:24 AM, "Paul" <[email protected]>
scribbled:
> OK, it was late at night, and working 7 days/week doesn't help. Anyhow,
> after looking at my convoluted script, I have one that works now, but am
> now trying to figure out an easy way to change the "/" in the resultant
> file to "\" to work in windows. Always something.
You may not have to. Many Windows programs that deal with paths will accept
the '/' character as a path separator.
If you do need to change '/' to '\':
$path =~ s{ / }{\\}gx;
is probably the best way. Remember that the replacement string of the
substitution operator is a double-quote string context, and '\' is a
meta-character, so needs to be doubled. The x modifier ignores whitespace in
the pattern part, but not the replacement part.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/