walkingthecow has asked for the wisdom of the Perl Monks concerning the following question:
# foo only has one element... if (@foo == 1) { ... }
my $num_elements=@foo; if ($num_elements == 1) { ... }
if ($foo[0] ne "" && $foo[1] eq "") { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test Number of Elements In Array
by jethro (Monsignor) on Jun 05, 2009 at 17:03 UTC | |
|
Re: Test Number of Elements In Array
by toolic (Bishop) on Jun 05, 2009 at 17:17 UTC | |
by AnomalousMonk (Archbishop) on Jun 05, 2009 at 17:32 UTC | |
by chromatic (Archbishop) on Jun 05, 2009 at 18:20 UTC | |
|
Re: Test Number of Elements In Array
by liverpole (Monsignor) on Jun 06, 2009 at 16:13 UTC | |
by JavaFan (Canon) on Jun 07, 2009 at 12:44 UTC | |
by liverpole (Monsignor) on Jun 07, 2009 at 15:45 UTC | |
by akho (Hermit) on Jun 07, 2009 at 15:58 UTC | |
|
Re: Test Number of Elements In Array
by ig (Vicar) on Jun 08, 2009 at 06:04 UTC |