I've started messing around with references today and I have a few questions.
I have a hash of a hash %clocks (eg $clock{<name>}{'speed'})
Now I want to read the outer hash in a subroutine. I was reading on
references and I think that's what I should use, but I'm not sure of
the syntax.
eg
foreach my $key (sort keys %clocks){ print_clock_assertions(\{ $clocks{'$key'} }); } sub print_clock_assertions { my($hashref)=$_[0]; print STDOUT "ref 1 :$hashref->{'speed'}\n"; }
This doesnt work so if you know what I'm at could you point me in the right direction?
Diarmuid
Edit: chipmunk 2001-04-19
In reply to hashes,references and subroutines by diarmuid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |