Post
by MacroSloth » Thu Oct 31, 2002 8:50 pm
Hi,
Think I found a bug in IRC20021024. I encourage you to read the whole message even after you see some perl snippets, I believe this bug to lie in the MQ code, not the Perl module.
Consider the following code (please note that the code style button doesn't work in this browser):
test.mac:
---------
#event tell
sub Event_chat
/if $p0~~"tell" {
/perl eval tell()
}
/return
sub Main
:Loop
/doevents
/goto :Loop
/return
-----------
Then in the perl code:
sub tell {
$msg=MQPerl::ParseVars("\$p2");
print "here: $msg";
}
You will see that $p2 is blank... HOWEVER:
1) $p0 and $p1 aren't...
2) if you change test.mac to read as follows it will work:
test.mac:
---------
#event tell
sub Event_chat
/if $p0~~"tell" {
/perl eval tell()
/varset v1 $p2
}
/return
sub Main
:Loop
/doevents
/goto :Loop
/return
-----------
Please note that I have set a dummy variable (v1) to the value of p2. Doing this makes the MQPerl::ParseVars("\$p2") work correctly for some reason.
MacroSloth