in reply to Re^2: top ten things every Perl hacker should know (script naming)
in thread top ten things every Perl hacker should know

Good list, but for

rename the file so it no longer ends in ".pl"

I think I'd prefer to create a link (hard or soft, whichever you feel more comfortable with) from whatItDoes to whatItDoes.pl, leaving the original file as it is. Only for those OSes that can do links of course.


All dogma is stupid.
  • Comment on Re^3: top ten things every Perl hacker should know (script naming)
  • Download Code

Replies are listed 'Best First'.
Re^4: top ten things every Perl hacker should know (link)
by tye (Sage) on Mar 16, 2006 at 18:57 UTC

    Are you saying you'd link the executable to some working copy of the *.pl file that you have checked out (so that you can't edit without affecting those using it) or to the *.pl inside the revision control system (may not be possible, prevents you from checking in unfinished changes) or that you'd put *.pl files into your "bin" directory? I wouldn't put *.pl files into a "bin" directory, since it tempts the use of the *.pl file which would break when the script gets reimplemented or wrapped in something and it just adds clutter, IMO.

    - tye        

      Yes, I would put the whatever.pl file in the bin directory, and almost precisely for the reason you give against it :-). This makes it possible for me to use whatever.pl directly in a script or system if I want that particular implementation. If you want to place a wrapper around it or reimplement it as "whatever", then that's fine, go ahead and I'll still be using the specific implementation I wrote my script against (and of course, if you're the admin there's nothing stopping you from linking whatever.pl to whatever, thereby forcing me to use the new implementation). Normal users will use whatever anyway and thus benefit from implementation changes directly.

      Yes this can be abused, but it provides maximum flexibility. Polite requests over shotguns and all that.


      All dogma is stupid.

        If there is a need to support multiple versions, then I support multiple version, each regardless of what it happens to be implemented in. Only supporting multiple versions when changing the language that something is implemented in seems of very limited value. So I find not publishing the *.pl name to be both more flexible and less confusing.

        - tye        

Re^4: top ten things every Perl hacker should know (script naming)
by apotheon (Deacon) on Mar 16, 2006 at 19:26 UTC

    I tend to "install" working copies of Perl programs normally, renamed without a file extension. When I'm working on code, though, I tend to keep it in a /home/username/src directory with a file extension, and softlink to it from a /home/username/bin directory with a shorter name (no file extension) so that I can test-run scripts more easily.

    I guess maybe I'm somewhere between the two of you on this one.

    print substr("Just another Perl hacker", 0, -2);
    - apotheon
    CopyWrite Chad Perrin