LPM: silliness

Rich Bowen rbowen at rcbowen.com
Sat Nov 13 13:37:45 CST 1999


Matt Cashner wrote:
> 
> ok. for gits and shiggles, i'm playing with IRC and a perl bot. i'm
> basically hacking Josh Harding's bot based on Chatbot::Eliza (i said it
> was silly).  by default the bot prints its main log to stdout. so for the
> time being i'm dumping it to a file (./elizairc.pl > main_log). the wierd
> part is that the file only is getting written to after i close the
> script.  am i missing something in bash that i should know by now? :)

$|=1; # Turn off buffering.

> 
> also, if i'm reading things right, filehandles are local, correct? if so,
> what's the proper syntax to pass a filehandle to subroutines?  or i
> smoking the wacky weed again? :)

Prolly what you want to do is pass a typeglob. Or, you can use the
File::IO module, which does some weird stuff, and lets you usea scalar
as a file handle, or something like that. I've never used it, just read
about it, but I'm pretty sure that's what you want to use.

Rich
-- 
http://www.ApacheUnleashed.com/
Lexington Perl Mongers - http://lexington.pm.org/
PGP Key - http://www.rcbowen.com/pgp.txt



More information about the Lexington-pm mailing list