Created
July 17, 2009 14:54
-
-
Save hercynium/149089 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature ":5.10"; | |
my @ar = qw( a b c d ); | |
my $ar_ref = \@ar; | |
say @ar; # abcd | |
say @$ar_ref; # abcd - same array, so same contents | |
# $#ar is the index of the last element in @ar | |
say $#ar; # 3 | |
say $#$ar_ref; # 3 - same array, same index | |
say $#($ar_ref); # warning! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment