note
LanX
<i>> If strict and warnings were turned on (as I showed) the problem would have shown itself very clearly.</i>
<p>
Nope, it's another problem just at the same place.
<p>
Using <C>my</C> fixes the errors but not the OP's problem, which is <C>foreach</C> localization and aliasing.
<c>
use warnings;
use strict;
my $string;
my @array_of_strings=1..3;
my $sref = \$string;
foreach $string ( @array_of_strings ) {
print $$sref;
}
__END__
Use of uninitialized value in print at - line 8.
Use of uninitialized value in print at - line 8.
Use of uninitialized value in print at - line 8.
lanx@nc10-ubuntu:~$
</c>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-708738">
<p>Cheers Rolf
</div></div>
1018620
1018744