trouble with passing of variables

Posted by Martijn on Mon 28 May 2007 11:17 PM — 2 posts, 18,062 views.

#0
below is a crosspost from Scripts. I'm having some real problems with variables under perl, and was wondering if anyone knows what is going on, or may be able to help me find a workaround. I have switched to Python for scriping, but I'm still a little annoyed that what I though should be working, doesn't.
Quote:

with my limited knowledge of OLE/COM objects I thought activePERL would magicaly poof it and make everything allright. It seems not. Even my targetting system, which was working properly before has gone dodgy now. I have it now as


<aliases>
<alias
script="setTarget"
match="^target (\w+)"
enabled="y"
ignore_case="y"
regexp="y"
name="targetting"
></alias>
</aliases>
<script>
<![CDATA[

sub setTarget{
my ($theName, $theOutput, $wildcards) = @_;
my $target = GetAliasWildcard($theName, "1");
$world->note("setting target to ".$target);
$world->setVariable("target",$target);
my $fetchedTarget = $world.getVariable("target");
$world->note("target is now ".$fetchedTarget);
}
]]>


as it is now, imputting

target bigbadwolf

should output


setting target to bigbadwolf
target is now bigbadwolf

right?
wrong. It gives


setting target to bigbadwolf
target is now Win32::OLE=HASH(0xfaa1b4)bigbadwolf

I'm confused now...
#1
as usually, its just a small typo:

my $fetchedTarget = $world.getVariable("target");

should be:

my $fetchedTarget = $world->getVariable("target");



cheers,

KP