in reply to Length of multidimensional array based on the particular index value

$ perl -le' my @select = ( [ "AAA", "A Description", 1, 0 ], [ "BBB", "B Description", 0, 0 ], [ "CCC", "C Description", 0, 0 ], [ "DDD", "D Description", 1, 0 ], [ "EEE", "E Description", 1, 0 ], ); my $length = grep $select[ $_ ][ 2 ], 0 .. $#select; print "Selective Length : $length"; ' Selective Length : 3
  • Comment on Re: Length of multidimensional array based on the particular index value
  • Download Code