"Silverfox" wrote...
[snip]
: OK...I rewrote the code..created the sub's..this is what am getting..any
: ideas:

I may be totally off the mark, but I think it's an issue of namespaces. Sort
of a variation of the same problem as before. Keep reading...

: ERROR:
: [laptop@localhost perl]$ ./aim.pl
: Including on_config.pl.. OK!
: Including on_error.pl.. OK!
: Including on_evil.pl.. OK!
: Including on_im.pl.. OK!
: Including sendim.pl.. OK!
: Including commands.pl.. OK!
: Including dosleep.pl.. OK!
: Including log_im.pl.. OK!
: Including warners.pl.. OK!
: Bot loaded successfully!!

The script continues, so everything is correct as far as syntax, so I'm just
assuming everything's well with them... Just in case, try using strict and
see if anything comes up.

[snip]
: #Setup usage of above directory/files (handlers,commands extras and log).
: @dirs = ("handlers","commands","extras","logs");
: foreach $dir (@dirs) {
:     opendir(DIR, "./$dir");
:     foreach $file (sort(grep(!/^\./, readdir(DIR)))) {
:         print "Including $file..";
:         require "$dir/$file";
:         print " OK!\n";
:     }
:     closedir(DIR);
: }

Loading them as you have works, unless you've given them an internal package
name, creating separate, mini-namespaces for each require. Which is ok now,
but causes problems below when you try to use the functions in them.

[snip]
: #Set up the handlers for commands issued by the server.
: $conn->set_handler('im_in', \&on_im);
: $conn->set_handler('error', \&on_error);
: $conn->set_handler('eviled', \&on_evil);
: $conn->set_handler('config', \&on_config);

Here, you have Net::AIM::set_handler() looking for a sub in the main
namespace. It just assumes that they are where you say they should be and
doesn't give any error. But, when the script tries to actually use them but
can't find them, it gives you an error like that above. To keep your basic
setup the way it is (handlers, commands, etc. in separate files), you'll
either have to change the above to:
[code]
 #Set up the handlers for commands issued by the server.
 $conn->set_handler('im_in', \&[what you put after 'package']::on_im);
.
.
.
[/code]

...or just remove the [code]package [...];[/code] line from each of your
handlers. Better yet, just copy and paste the functions from each of your
handler scripts into the main script. If you haven't defined seperate
package names, then... well, I have no idea. -.-;;;

Your second error, about the split, is probably resultant of an empty config
string being sent as a buddylist.

I'm actually working on my own Net::AIM project [aimSN: BloggerAPIBot], so
I've run into a lot of the hangups and glitches. Just wait until you get
disconnected...
-- 
Sanko http://hisdesk.org/
reverse(split//,'gro]tod[ksedsih]ta[tcatnoc')

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

Reply via email to