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

Maybe its the version of perl im using. Im also on windows. when I run perl -d script.pl I get a gui and I can step thru each line of code. I get no errors at all using the code I posted. I can remove the -w or the whole shebang and it makes no difference in -d or any other instance of it running.
  • Comment on Re^6: Debugger actions: On which lines?

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

      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.

      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.