in reply to hashes,references and subroutines

Lets first deal with the main code. You wrote:

foreach my $key (sort keys %clocks){ print_clock_assertions(\{ $clocks{'$key'} }); }

By putting single quotes around $key, you are now passing literally the text $key to the subroutine so you need to remove those single quotes as in:

foreach my $key (sort keys %clocks){ print_clock_assertions(\{ $clocks{$key} }); }

Next, as I understood you you had has that contained references to hashes that contained clock information. In which the act of writting $clocks{$key} would return a reference to a clock hash, so you don't need to enclose the that in \{ }. So the next revision is:

foreach my $key (sort keys %clocks){ print_clock_assertions($clocks{$key}); }

Your subroutine looks fine, though I always have problems discerning when perl will recognize something as an expression in double quotes or not. So if you do have problems change:

print STDOUT "ref 1 :$hashref->{'speed'}\n";

To:

print STDOUT "ref 1 :", $hashref->{'speed'}, "\n";
Cheers...james