in reply to Re: Hash sorting
in thread Hash sorting

Thanks, printing it out when needed will do just fine,
however I need to print both the key names and values.
Apologies as I'm new to perl.

Replies are listed 'Best First'.
Re^3: Hash sorting
by davorg (Chancellor) on May 15, 2006 at 08:33 UTC
    however I need to print both the key names and values

    Then print both :)

    foreach my $key (sort keys %hash) { print "$key : $hash{$key}\n"; }

    Update: typo fixed. Thanks to johngg for pointing it out.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      ITYM print "$key : $hash{$key}\n";

      Cheers,

      JohnGG