Dan Muey wrote:

> > That won't work if the write decides that "file1" should be a
> > variable instead.  Just a thought :-/
>
> Ok, in the example file1 wasn't a variable but if you dod want to do
> \\machine1\share\$file
>
>  copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) or ...
>
> Would that cover all the bases?
>
> DMuey

Hi Dan,

I think what you would be looking for here is the quotemeta function.
AFAIK, qq()  only substitutes for the double quotes, but does not escape
control characters.  Use quotemetas to prepare a literal string for double
quotes.  I haven't used it much, though, so I don't know whether it will
also escape scalar indicators and toast interpolated variables.

I think it is best to explicitly escape the path separators if you are
going to include variables.

Of course, it is questioable whether backslashes are necessary anyway.
Unless the string is to be handed direct to the Win/DOS system in a system
call, they shouldn't be needed.  All Perl file-handling functions properly
abstract path separators, so you can use forward slashes for all file-paths
and trust the language to interpret the path in the context of the local
file system.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to