Skip to content

Instantly share code, notes, and snippets.

@tomcha
Created July 14, 2019 11:51
Show Gist options
  • Save tomcha/d276c649081e4ce13ad2fe956c33c454 to your computer and use it in GitHub Desktop.
Save tomcha/d276c649081e4ce13ad2fe956c33c454 to your computer and use it in GitHub Desktop.
ref_allow.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my $allow = {1 => ['a', 'b', 'c'], 2 => ['d', 'e', 'f']};
say $allow->{2}->[0]; #OK
say $allow{2}[0]; #エラー(use strictはずすと通る)
say $allow->{2}[0]; #OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment