wimvanherp
Programmer
I have a problem with variable references in subroutines:
if you see my simple program below i think it should print : abcdefgh, but it returns : SCALAR(0x15dd8d4)edfg.
what's wrong with my subroutine ?
use strict;
sub sub1
{ my($VAR)=@_;
my $TEMP=$VAR;
my $TEMP=$VAR."efgh";
print $TEMP;
$$VAR=$TEMP;
}
my $T="abcd";
&sub1(\$T);
print $T;
Wim Vanherp
Wim.Vanherp@belgacom.net
if you see my simple program below i think it should print : abcdefgh, but it returns : SCALAR(0x15dd8d4)edfg.
what's wrong with my subroutine ?
use strict;
sub sub1
{ my($VAR)=@_;
my $TEMP=$VAR;
my $TEMP=$VAR."efgh";
print $TEMP;
$$VAR=$TEMP;
}
my $T="abcd";
&sub1(\$T);
print $T;
Wim Vanherp
Wim.Vanherp@belgacom.net