in reply to Is there a better way to check if an array is empty?
I want this for loop to get executed only when @array has elements.Then no check is needed.
foreach my $base_p4path (@array) { # Execute once for each element in @array. # Hence *NO* loop iteration if @array is empty. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there a better way to check if an array is empty?
by iphone (Beadle) on Dec 21, 2010 at 19:08 UTC | |
by JavaFan (Canon) on Dec 21, 2010 at 19:27 UTC | |
by iphone (Beadle) on Dec 21, 2010 at 19:33 UTC | |
by GrandFather (Saint) on Dec 21, 2010 at 20:24 UTC | |
by JavaFan (Canon) on Dec 21, 2010 at 20:35 UTC | |
by Marshall (Canon) on Dec 23, 2010 at 09:11 UTC |