G.D. Bell wrote:
> Hi all
>
> I've started composing this script but seem to be a
> little stuck at the moment ..when I run script as it
> is presntly these errors occur..Name "main::alt_nick"
> used only once: possible typo at maria.pl line 26.
> Name "main::awaytime" used only once: possible typo at
> maria.pl line 28.
> Name "main::idletime" used only once: possible typo at
> maria.pl line 29.
> Name "main::awayreason" used only once: possible typo
> at maria.pl line 27.
> Undefined subroutine &IRC::register called at maria.pl
> line 18.
>
> the script I have began is as follows..it may not look
> the greatest due to cut and paste.
>
> #!/usr/bin/perl -w
> ############################################################
> # Maria V0.1 (this script is for spam protection
>     #                                             #
> # and xchat related away functions)
>     #
> # load into ~/.xchat directory
>     #
> #
>     #
> # Copyright 2003-2004 Gbell72  <[EMAIL PROTECTED]>
>     #
> #
>     #
> #
>     #
> # Please submit bug-reports to the email provided
>     #                                               #
> #
>     #
> #
>     #
> #
>     #
> ############################################################
>
> # Script begins here

    use strict;
    use IRC;

    use subs qw(
        set_alt_nick
        set_away_time
        set_idle_time
        set_away_reason);

(assuming these are subroutines)

> IRC::register("Maria", "v0.1", "", "");
> IRC::print ("loading Maria\n");
> IRC::print ("registering handlers\n");
>
> # Message Logging
> IRC::add_message_handler("PRIVMSG",
> "privmsg_handler");
>
> # Variables
> $alt_nick = "set_alt_nick";
> $awayreason = "now rests in peace.";
> $awaytime = "500";
> $idletime = "5000";

    my $alt_nick = "set_alt_nick";
    my $awayreason = "now rests in peace.";
    my $awaytime = "500";
    my $idletime = "5000";

> # Away Functions
> IRC::add_command_handler("gbell72", set_alt_nick);
> IRC::add_command_handler("gbell72|afk", set_alt_nick);
> IRC::add_command_handler("working be back later", set_away_reason);
> IRC::add_command_handler("500", set_away_time);
> IRC::add_command_handler("5000", set_idle_time);

Is this the end of your script so far? If so then you're pretty much OK,
as all the error messages are telling you is that you've assigned
values to those variables and never used them again. It's also
a little upset that you've called a method from the IRC module
without first 'use'ing the module.

Always 'use strict'. It will find many problems for you.

Cheers,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to