hashtest.pl to HTML.

index -|- end

Generated: Tue Feb 2 17:54:42 2010 from hashtest.pl 2008/11/11 558.

#!perl -w
# NAME: hashtest.pl
# AIM: Test some HASH games
# 11/11/2008 - geoff mclane - http://geoffair.net/mperl
# ####################################################
use strict;
use warnings;
# are these equivalent?
my %hash1 = ( one => 'one', two => 'two' );
my %hash2 = ( 'one' => 'one', 'two' => 'two' );
show_hash ( \%hash1 );
show_hash ( \%hash2 );
# it seems they are ...
exit(0);
sub show_hash {
    my ($hr) = shift;
    foreach my $key (keys %{$hr}) {
        my $val = $$hr{$key};
        print "$key = $val\n";
    }
}

index -|- top

checked by tidy  Valid HTML 4.01 Transitional