Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Search & Replace repeating characters

by Marshall (Canon)
on Apr 22, 2020 at 23:59 UTC ( [id://11115917]=note: print w/replies, xml ) Need Help??


in reply to Re: Search & Replace repeating characters
in thread Search & Replace repeating characters

I agree with that. I mean C:\\temp is an invalid path under Windows. It would be better to fix the thing that generates this invalid path rather than trying to hack that path into a valid path. The crux of an X-Y problem is that the OP is asking the wrong question or that the question is not well specified.

Replies are listed 'Best First'.
Re^3: Search & Replace repeating characters
by kcott (Archbishop) on Apr 23, 2020 at 08:30 UTC
    "I mean C:\\temp is an invalid path under Windows."

    While I'm not disagreeing with that absolute statement, C:\\temp may be required under a Windows environment. I came across an example of this fairly recently.

    Consider a pp command on cmd.exe something like this (using Strawberry Perl):

    C:\some\dir>pp @long_list_of_options.txt -o filename.exe filename.pl

    Options (in long_list_of_options.txt) which include paths cannot be written like this for example:

    --link=C:\path\to\some.dll

    The parts like \X will be interpreted as backslashed escapes: resulting in just X, or special characters (e.g. newline, tab, and so on). The example option I showed would end up like:

    --link=C:path osome.dll

    In order to get it to resolve to the example shown, you'd need to write:

    --link=C:\\path\\to\\some.dll

    That doesn't mean that an XY Problem doesn't exist; it just shows that it might not exist. Having said that, the terminal \\\\ certainly looks highly dodgy.

    — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-25 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found