note
davidj
First of all, the syntax in the sub is incorrect:<BR>
<code>
%s{'a'} = 10 ;
%s{'b'} = 20 ;
%s{'c'} = 30 ;
</code>
should be
<code>
$s{'a'} = 10 ;
$s{'b'} = 20 ;
$s{'c'} = 30 ;
</code>
anyway, the following change will work for you:
<code>
#!/usr/bin/perl
use strict ;
use warnings ;
foreach ( keys %{&testa} ) {
print "key is $_\n" ;
}
sub testa {
my $s = () ;
$s->{'a'} = 10 ;
$s->{'b'} = 20 ;
$s->{'c'} = 30 ;
return $s ;
}
</code>
hope this helps,<BR>
davidj
558527
558527