in reply to Re^6: Debugger actions: On which lines?
in thread Debugger actions: On which lines?

And what is the point of having this shebang line:
#!/usr/bin/perl -w
or even more:
#!/usr/bin/perl
under Windows?

It makes very little sense...

Replies are listed 'Best First'.
Re^8: Debugger actions: On which lines?
by Your Mother (Archbishop) on Aug 18, 2015 at 19:53 UTC

    At least three decent reasons in general: show intent, help other scripts/utilities with file type/content discovery, and portability.

      IMHO, none of the three reasons above really apply to Windows.

      Show intent?

      How does #!/usr/bin/perl say anything to a Windows user that has never used Unix or Linux? If you intend to inform the reader that this is a Perl program (hopefully the reader should know), you might as well add a comment:

      # This is a Perl program that should be called as follows: # perl blahblah (args)
      Probably clearer for a Win user..

      help other scripts/utilities with file type/content discovery

      Under Windows?

      Portability?

      Well, not under Windows... And, under Unix/Linux, I can think of at least half a dozen places where the Perl interpreter file might be located.

      This is not to say that I don't get your points (I upvoted your post), I am just not fully convinced.

        Not too worried about "users," just power users and hackers who might see a .exe or something and want to peek. That style of comment is not best practice for Perl (use Pod) and useless for anyone who isn't a hacker or least knows how use the "cmd line." For portability I meant between platforms and the "proper" idiom for the script is #!/usr/bin/env perl so there are perhaps fewer places on *nix :P

        Anyone can of course do what she thinks best or easiest. It doesn't cost anything to have a shebang though and it could potentially save someone else some trouble. I am not pushing for the style but I would do it (if I were developing on Win these days but I haven't needed to for years).

Re^8: Debugger actions: On which lines?
by james28909 (Deacon) on Aug 18, 2015 at 19:34 UTC
    I never use the shebang unless i am in VM. I just copied code as is.
      Neither do I. Well, under Unix, I most often have at the top something like
      #!/usr/bin/perl
      but I don't actually use it most of the time. My shell sripts launching my Perl programs usually have a line like this:
      perl foo.pl
      or perhaps:
      sort -someshellsortoptions file.txt | perl bar.pl
      In brief, I am usually calling Perl explicitly. And I usually don't even care about changing file permissions to executable.

      And on other systems (Windows/Dos, VMS, etc), it also works usually better this way.