Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Need help with badwords routine

by chrism01 (Friar)
on Oct 21, 2008 at 06:57 UTC ( [id://718382]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://718382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-03-29 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found