in reply to win32 shebang

First of all, the shebang line is only the line beginning with '#!'. You remarked correctly that on Windows this has no meaning to the OS but perl will always look into that line and extract command line parameters if it contains the word perl. From this point of view it doesn't matter if you write #!perl or #!/usr/bin/perl or #!ohmegod, it's perl. On *nix this line specifies the location of the perl executable which is normally (but not always) located in /usr/bin.

Concerning the use statements, I would go for

use 5.6.0; use strict; use warnings;
as was recently discussed here. The discussion there also explains the difference between perl -w and use warnings; Your use win32; includes the win32 which provides specific functions for Windows (surprise :) but you only use it if you need some of these functions.

-- Hofmator

Replies are listed 'Best First'.
(tye)Re: win32 shebang
by tye (Sage) on Aug 08, 2001 at 23:43 UTC

    Um, please don't do "use 5.6.0;" as that doesn't work quite right in versions of Perl prior to v5.6. Do "use 5.006;" instead.

            - tye (but my friends call me "Tye")
      So what does it do?

      My guess is that it will parse it as the float 5.6 and ignore the rest. That will be compared against the internal 5.005 and it will tell you (correctly) that it's not good enough.

        Since when does Perl just ignore things? (: It gets parsed as "5.6" . "0". Yes, it happens to produce the somewhat correct result of telling you that you need to use something like version "5.60", which could certainly be confusing. Sorry, I don't have 5.005 handy to get the exact message and 5.004 doesn't support the "use VERSION" (nor "require VERSION") syntax.

        I also think it is important to make people aware that they need to use "old-style" version numbers in the one part of their code that is only meant to be useful in old versions of Perl. The very similar "use v5.6.0;" is going to produce an even less obvious error message.

        But I also realize that it is more important to put the line in than it is to get it exactly right. At least having an error message that points to that particular line will be more helpful than the other likely failure modes. (Besides, just as far back as 5.004, there is no great way to automatically tell the user that they need to upgrade.)

                - tye (but my friends call me "Tye")