in reply to 'Invisible' newlines/line wrapping

Thank you so much! And I would append -w to #!perl (or on UNIX systems, the line with #!/usr/bin/perl) to print the warnings, right?

Replies are listed 'Best First'.
Re^2: 'Invisible' newlines/line wrapping
by GrandFather (Saint) on Apr 23, 2010 at 02:49 UTC

    Always use strictures (use strict; use warnings). Not just warnings (which you sort of get with -w), but strict too.

    -w applies to the entire script which will affect modules too. use warnings only applies to the enclosing block (normally a file) and is generally most appropriate.

    True laziness is hard work
Re^2: 'Invisible' newlines/line wrapping
by ww (Archbishop) on Apr 23, 2010 at 02:03 UTC
    Not exactly.

    A "-w" on the shebang line has slightly different effects that "use warnings;" on a following line.

    You deserve a reference to read about those differences; sorry; it's waaaay past bedtime, so perhaps another Monk will provide one. Meantime, try searching for "pragmata."

      You deserve a reference to read about those differences
      From warnings:
      The warnings pragma is a replacement for the command line flag -w , but the pragma is limited to the enclosing block, while the flag is global. See perllexwarn for more information.
      Also: perllexwarn