in reply to "perl script.pl args" or "script.pl args"

Neither!

I consider it a rather large mistake to have a tool that you invoke via either "perl ..." or "....pl ...". I often make improvements to tools that result in them being implemented in different languages. A tool might start out as a shell script or batch file and later become a Perl script and then a compiled executable (sometimes these transition even happen in the other direction). I just want to use the tool, using a descriptive name. I don't want to think about what language it happens to have been implemented in this week.

And I really don't want to worry about updating a bunch of other tools that make use of that tool just because I decide to change implementation language.

For me, the *.pl file is the source code for the script. It starts with "#!/usr/bin/perl" plus whatever options the script needs. Then there is the install process that does the follow things on Unix:

On Win32:

                - tye
  • Comment on Re: "perl script.pl args" or "script.pl args" (neither/install)

Replies are listed 'Best First'.
Re2: "perl script.pl args" or "script.pl args" (neither/install)
by dragonchild (Archbishop) on Jul 18, 2003 at 16:11 UTC
    Excellent node! ++!

    Would you mind doing a meditation on Perl installation process, or even just "How I set up a new application environment" ... ? I would love to see the thoughts of some of the monks on the matter ...

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Re^2: "perl script.pl args" or "script.pl args" (neither/install)
by Aristotle (Chancellor) on Jul 23, 2003 at 00:52 UTC
    I don't like dot-slashing something in the current directory to run it. Prepending a perl is just easier - though that might be different if I was a real touchtypist. So by that token should I do the
    #!/bin/sh eval 'exec perl -wS $0 ${1+"$@"}' if 0;

    at the top of my scripts and invoke them all with sh foo? :^)

    PS: Since I've replied to half the original question: my editor puts the shebang line in there for me, so I always have one - unless I'm trying something real quick like, which I do just like jeffa (launch perl, paste, Ctrl-D).

    Makeshifts last the longest.