Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Execute a Perl code without ".pl" extension

by Moriarty (Abbot)
on Mar 10, 2006 at 01:45 UTC ( [id://535589]=note: print w/replies, xml ) Need Help??


in reply to Re: Execute a Perl code without ".pl" extension
in thread Execute a Perl code without ".pl" extension

This isn't completely true

1) This will only work if the perl executable is in /usr/bin/ (which just happens to be the most popular place to put it).

2) It is not necessary to rename the script as *nix doesn't care about extensions.

  • Comment on Re^2: Execute a Perl code without ".pl" extension

Replies are listed 'Best First'.
Re^3: Execute a Perl code without ".pl" extension
by moklevat (Priest) on Mar 10, 2006 at 02:03 UTC
    Fair enough, but even though *nix doesn't care what the file is named, the OP wanted to know how to do

    $ ./myperlcode param > someoutput.txt

    and the original script was named myperlcode.pl.

      My personal preference is to leave to ".pl" in place as it tells me that I can edit it as a normal Perl script.

        At least where I'm sitting, "executables" are sometimes compiled, sometimes perl scripts, sometimes shell scripts...you get the idea. I use the "file" command to tell me what's what. And hey...file uses magic...really. The file that stores the heuristics that it uses for guessing is /etc/magic. :)

        thor

        The only easy day was yesterday

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found