Skip to content

Instantly share code, notes, and snippets.

@tomcha
Created Jul 14, 2019
Embed
What would you like to do?
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