Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: What is the meaning of this line in Perl on linux?

by Marshall (Canon)
on Mar 29, 2022 at 06:08 UTC ( [id://11142482]=note: print w/replies, xml ) Need Help??


in reply to Re^3: What is the meaning of this line in Perl on linux?
in thread What is the meaning of this line in Perl on linux?

What a hoot!

I guess "pre-Modern" means Windows 3.1, April 6, 1992?
Most folks who just look at the command line, see the back slashes and don't really think about or reference the API spec.

I think that the case for using forward slash on Windows as well as Unix has been made. There are many folks who don't know that forward slash works on Windows (with exception that you pointed out). The fact that the Windows command line displays back slashes throws many folks off.

  • Comment on Re^4: What is the meaning of this line in Perl on linux?

Replies are listed 'Best First'.
Re^5: What is the meaning of this line in Perl on linux?
by afoken (Chancellor) on Mar 29, 2022 at 06:51 UTC
    I guess "pre-Modern" means Windows 3.1, April 6, 1992?

    Nope. All DOS versions back to at least 2.0 (March 1983) supported both forward and backslashes in paths. Using the backslash was more or less just a convention, partially enforced by programs using the forward slash to indicate an option (instead of a path). But the switch character could be changed from DOS 2.0 up to 3.31 to something else, and so the forward slash could have been used in paths even on the command line (see Re^6: moving from mac to PC -- win internal commands). The DOS API functions (i.e. int 0x21) always accepted both forward and backslashes.

    DOS 1.x had no subdirectories and thus did not need and did not use forward or backslashes. Each (floppy) drive had exactly one directory, the root directory, and thus it was sufficient to prefix a filename with the drive letter and a colon to get an absolute path.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      Another tribute to the amazing depth of knowledge of the Monks!

      My experience pre-dates DOS and even I didn't remember this DOS 1.x stuff!

      But we are still back at the same point: use forward slash unless you have a specific reason to do otherwise.

Re^5: What is the meaning of this line in Perl on linux?
by eyepopslikeamosquito (Archbishop) on Mar 29, 2022 at 06:48 UTC

    As you might expect, Windows PowerShell is fine with forward slashes in file paths. Hopefully, as PowerShell gradually supplants the truly awful old CMD.EXE there'll be even less need to use backslashes in Windows file paths.

      cmd is fine with "/" as well, though quoting is necessary.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 02:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found