in reply to simple script question scope/structure for Perl noob

For a start put:

use strict; use warnings;

at the start of your script.

By the time you have removed all the warnings and errors your problem will have changed!

Some sample data would help. You may like to use <DATA> rather than <FILE> and put a __DATA__ section at the end of your script.

Update: Add sample data comment


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: simple script question scope/structure for Perl noob
by mrborisguy (Hermit) on Jun 26, 2005 at 22:12 UTC

    Well, at least use strict; I would think the warnings part would be covered by the #!/usr/bin/perl -w line.

        -Bryan

      In this case, I'd put use warnings anyway. Note that OP's shabang does not start from the very first character in the script, because there are some lines of comment before (and an empty one, too). Thus, the -w switch is likely to be ignored in this case.

      Flavio
      perl -ple'$_=reverse' <<<ti.xittelop@oivalf

      Don't fool yourself.

      My eye skipped over it. Can't even blame coffee lack :^(


      Perl is Huffman encoded by design.