boilera has asked for the wisdom of the Perl Monks concerning the following question:
hi guys,
I have a stuped problem I'm using Net::IRC and i'm trying to write a IRC bot. I want to store some data in a file from web form and then read this data from bot script in IRC. the problem is that when I have the variable $nick in the text file it has no value but have just $nick ( as a string ) here are my files ( part of them )
its my text file ( test.irc )
##########
!beer|give to $nick one beer|cheers $nick
#############
its part of my bot file
##########
open(INF,"test.irc"); @ary=<INF>; close(INF); foreach $line (@ary) { chomp($line); ($txt_cmd,$txt_me,$txt_chan)=split(/\|/,$line); if ($text eq $txt_cmd){ $conn->me($conn->{channel},"$txt_me"); $conn->privmsg($conn->{channel}, "$txt_chan"); } }
###############
here is my output in IRC
[00:13] <boilera> !beer [00:13] * Curolina give to $nick one beer [00:13] <Curolina> cheers $nick
but I want this to be like this :
[00:13] <boilera> !beer [00:13] * Curolina give to boilera one beer [00:13] <Curolina> cheers boilera
thanx to all that will reply
boilera
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems with Net::IRC
by jasonk (Parson) on Feb 16, 2003 at 22:30 UTC | |
|
Re: Problems with Net::IRC
by Wonko the sane (Curate) on Feb 17, 2003 at 01:31 UTC | |
by boilera (Initiate) on Feb 17, 2003 at 22:14 UTC |