H
howa
Hi,
Conside the following simple program:
#-----------------------------------------------------
sub test {
my $i = "999";
return \$i;
}
print ${test()};
#-----------------------------------------------------
i can still get "999", althought $i is a local variable in a procedure.
i want to ask : is it safe to use reference in the way?
or when the garbage collection will clear the reference?
thanks...
Conside the following simple program:
#-----------------------------------------------------
sub test {
my $i = "999";
return \$i;
}
print ${test()};
#-----------------------------------------------------
i can still get "999", althought $i is a local variable in a procedure.
i want to ask : is it safe to use reference in the way?
or when the garbage collection will clear the reference?
thanks...