in reply to more fun with references and hashes

To my knowledge, you cannot return a hash, you have to return a reference from your sub, so return \%new_hash, and in your main code:
my $ref = duplicate_probe_signals(\%clocks); my %new_hash = %$ref;
Hope this helps.. -malloc

Replies are listed 'Best First'.
Re: Re: more fun with references and hashes
by larryk (Friar) on May 30, 2001 at 23:57 UTC
    It is possible to return a hash...
    #!perl -w use strict; use Data::Dumper; sub test { my %hash = ( a => 1, b => 2, c => 3, ); return %hash; } my %got_this = &test; print Dumper( \%got_this );
    The hash returned is simply a list that happens to have an even number of values (and unique values in the key positions 0,2,4,6,8etc.).

    "Argument is futile - you will be ignorralated!"