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

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

  • Comment on Re^8: Debugger actions: On which lines?

Replies are listed 'Best First'.
Re^9: Debugger actions: On which lines?
by Laurent_R (Canon) on Aug 18, 2015 at 20:21 UTC
    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).

        How interesting this has been.

        I do #!/usr/bin/perl -w by reflex. I have been criticised because it turns on warnings globally - but I could never see why I would not want that! This is a reason not to use "-w", but it is a bug not a feature.

        Thans every body, this has been fun!

        Arghhhh! I just spent 20 minutes of my life preparing a bug report using "perlbug". After crafting a splendid report (truly splendid) I was prompted to send it, I did and the stupid programme tried to send the report by port 25 which failed (I send mail in other ways) and after it failed as far as I can tell my bug report (did I say it was truly splendid?) has been lost for ever!!! Perhaps I should learn python\t\t\n\t!

        A very grumpy Worik