in reply to Need help with badwords routine

As above, upgrade to Perl5 syntax:
#!/usr/local/bin/perl -w use strict;
Don't use '&' to call a sub, that's deprecated, basically now means a ref-to-sub.

To access/assign 1 element of an array, don't use

@vars[0] = $name;
use
$vars[0] = $name;

Replies are listed 'Best First'.
Re^2: Need help with badwords routine
by tinita (Parson) on Oct 21, 2008 at 08:56 UTC
    Don't use '&' to call a sub, that's deprecated, basically now means a ref-to-sub.
    That's wrong. It's deprecated, but:
    \&foo is a reference to the sub foo.
    &foo is a call to the sub foo which circumvents prototypes, and additionally because of the lack of parentheses it gives the current @_ as an argument to foo.
Re^2: Need help with badwords routine
by chrism01 (Friar) on Oct 21, 2008 at 07:02 UTC
    Darn, no edit facility.

    Anyway, amend

    open(BADWORDS,"$badword_file");
    to
    open(BADWORDS,"<","$badword_file") or die "Unable to open badword_ +file: $! \n";
    or similar