Skip to content

Instantly share code, notes, and snippets.

@sioncojp
Created April 25, 2013 07:19
Show Gist options
  • Select an option

  • Save sioncojp/5458070 to your computer and use it in GitHub Desktop.

Select an option

Save sioncojp/5458070 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use warnings;
use strict;
my $profile01 = {
id => 'sion_cojp',
lang => [
'perl',
'bash',
],
};
# デリファレンス
# 無名リスト
my $profile02 = ['nobita', 'suneo', 'jaian'];
print "@$profile02\n"; #nobita suneo jaian
print "$profile02->[2]\n"; #jaian
# 無名リファレンス
# 無名ハッシュ
my $profile03 = {
id => 'sion_cojp',
lang => [
'perl',
'bash',
],
};
print %$profile03; #langARRAY(0xab0be0)idsion_cojp
print "\n";
print "$profile03->{id}\n"; #sion_cojp
print "$profile03->{lang}[0]\n"; #sion_cojpperl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment