Skip to content

Instantly share code, notes, and snippets.

@note103
Created December 21, 2013 03:11
Show Gist options
  • Select an option

  • Save note103/8064905 to your computer and use it in GitHub Desktop.

Select an option

Save note103/8064905 to your computer and use it in GitHub Desktop.
hash_ref_test.pl
use strict;
use warnings;
my %hash = (
hoge => 33,
var => 44,
foo => 55,
);
my $ref = {
fuga => 66,
piyo => 77,
nyaa => 88,
};
my $result1 = $hash{var};
my $result2 = $hash->{var};
my $result3 = $ref{nyaa};
my $result4 = $ref->{nyaa};
print "$result1\n";
print "$result2\n";
print "$result3\n";
print "$result4\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment