I should have been more specific.Basically I want to push $newfile to another array @newfiles only if the array is empty and the instructions after the push instruction should not be executed.The following works for me but I want to know if there is a better way
if{ my $newfile="$file\n"; @array = grep(/\Q$newfile\E/,keys %hash); if (!@array) { push @newfiles,$newfile; #last; } next unless (@array); ..................... }
In reply to Re^2: Is there a better way to check if an array is empty?
by iphone
in thread Is there a better way to check if an array is empty?
by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |