in reply to Using HTML::Parser for simple tag removal

#!/usr/bin/perl -w
is the same thing as
use warnings;
Maybe you typo-ed, but I think what you want is use strict;
You may also want use CGI qw/:standard/;
Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
  --Ralph Waldo Emerson

Replies are listed 'Best First'.
Re^2: Using HTML::Parser for simple tag removal
by ikegami (Patriarch) on May 25, 2005 at 21:16 UTC

    That's not true. use warnings is blocked-scoped or file-scoped if not in a block, while -w will affect modules too.

    >type script.pl use warnings; use Bla; Bla->test(); >type bla.pm package Bla; sub test { print(undef); } 1; >perl script.pl >perl -w script.pl Use of uninitialized value in print at Bla.pm line 5.

    -w is actually equivalent to BEGIN { $^W = 1 } at the top of your script.

    What you should have said is that use warnings is redundant when using -w.

Re^2: Using HTML::Parser for simple tag removal
by freddo411 (Chaplain) on May 25, 2005 at 20:30 UTC
    #!/usr/bin/perl -w
    is the same thing as
    use warnings;
    Not exactly. If you are using an old version of perl 5.005 you need to do -w and not "use warnings;".

    You should "use strict;"

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday

Re^2: Using HTML::Parser for simple tag removal
by bradcathey (Prior) on May 25, 2005 at 20:30 UTC

    Not sure either one of those makes a difference. And use warnings; is not a typo. And I was under the impression that -w was not the same in that it was a lot more broad in scope. Anyway.... And didn't know HTML::Parser needed CGI.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot