Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: (OT) Fixing Line Endings

by jbert (Priest)
on Nov 30, 2006 at 14:48 UTC ( #586951=note: print w/ replies, xml ) Need Help??

in reply to Re: (OT) Fixing Line Endings
in thread (OT) Fixing Line Endings

The #!...\n line at the beginning of an executable file on a Unix system is recognised as telling the kernel that this is a script, to be passed to the interepreter named in the ... part.

If the line is '#!/usr/bin/perl\r\n' (as it would be on a Windows box), the kernel will attempt to find a file called '/usr/bin/perl\r'.

It's a hilarious (but real) solution.

Comment on Re^2: (OT) Fixing Line Endings
Replies are listed 'Best First'.
Re^3: (OT) Fixing Line Endings
by Melly (Hermit) on Nov 30, 2006 at 14:56 UTC

    Ah! Tnx. Hmm... couldn't you create a perl script /usr/bin/perl\\r and have that handle the problem?

    Tom Melly,
      Creating the symlinks is an even lighter-weight way of doing it.
      Hmm... couldn't you create a perl script /usr/bin/perl\\r and have that handle the problem?

      That's essentially what they did. A symbolic link is a UNIX way of saying: "this file is the same as that file over there". They're like Perl references, only for a file system.

      The real problem was getting the symlink command to run from the shell command line: eventually, they gave up, and used perl instead...

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-11-26 00:41 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (694 votes), past polls