Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: Program Not Found when run from browser page

by harangzsolt33 (Deacon)
on Nov 14, 2024 at 02:12 UTC ( [id://11162696]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Program Not Found when run from browser page
in thread Program Not Found when run from browser page

Yeah, it's true, you don't need to double the backslash if they are enclosed in single quotes or q(), however if the backslash happens to be the last character in the string, then it must be double. So, it's just easier to remember to always double it.

Incorrect: 'C:\Windows\'

Correct: 'C:\Windows\\'

Incorrect: q(C:\Windows\)

Correct: q(C:\Windows\\)

This is easier to rememeber: 'C:\\Windows\\' or "C:\\Windows\\"

  • Comment on Re^5: Program Not Found when run from browser page

Replies are listed 'Best First'.
Re^6: Program Not Found when run from browser page
by soonix (Chancellor) on Nov 14, 2024 at 09:00 UTC
    It is worth mentioning that most Windows programs (nearly all, with the notable exception of CMD.EXE and Explorer.exe) do understand forward slashes as "path separator".

    So, for most system functions outside of Batch "Scripts", you can use "C:/Windows/".

    If in doubt, use e.g. catfile/catdir of File::Spec or canonpath of Path::Tiny.

    Update: in Stackexchange's "Retrocomputing" section someone writes the following, which coincides with my experience:

    All dedicated path names, like in syscalls, can be written with either slash. It's only within the command line scan of each command, that simple slashes get interpreted as switch indicators.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2026-01-14 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.