Page 1 of 2

bug in IRC20021024

Posted: Thu Oct 31, 2002 8:50 pm
by MacroSloth
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

Posted: Thu Oct 31, 2002 9:24 pm
by Lurker_005
How is setting v1 AFTER the /perl eval doing anything different...

Is that a typo and the varset should be before the /perl eval?


RE: code brackets
just type {code} place code snippet here {/code}
{} instead of [] used to keep from activating the code tag

Re: bug in IRC20021024

Posted: Sat May 31, 2025 4:30 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:07 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:08 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:09 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:45 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:46 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:48 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:49 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:50 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:51 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:52 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:53 pm
by xyilla

Re: bug in IRC20021024

Posted: Sat May 31, 2025 5:54 pm
by xyilla