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


In reply to Problems with Net::IRC by boilera

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.