in reply to Re^2: Checking if all the key values are same in an Array
in thread Checking if all the key values are same in an Array
which should print "no" but does not, and#!/usr/bin/perl use strict; my @array = ( {key1=>0, key2=>2, key3=>3}, {key1=>1, key2=>2, key3=>3}, {key1=>0, key2=>2, key3=>3} ); my $amount = scalar(@array); if (!$array[0..$amount]->{key1}) { print "no\n" }
which should not print "no" but does.#!/usr/bin/perl use strict; my @array = ( {key1=>0, key2=>2, key3=>3}, {key1=>1, key2=>2, key3=>3}, {key1=>0, key2=>2, key3=>3} ); my $amount = scalar(@array); if (!$array[0..$amount]->{key1}) { print "no\n" }
|
|---|