Skip to content

Instantly share code, notes, and snippets.

@ywindish
Created March 22, 2012 02:47
Show Gist options
  • Save ywindish/2155298 to your computer and use it in GitHub Desktop.
Save ywindish/2155298 to your computer and use it in GitHub Desktop.
配列の要素数、配列の添え字最大値を求めるには
#
# 配列の要素数、配列の添え字最大値を求めるには
# http://codepad.org/SrwvXijK
#
use strict;
my @hoge = (1,2,3);
my $fuga = [1,2,3];
print scalar @hoge, $#hoge;
print scalar @{$fuga}, $#$fuga;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment