- or download this
if ($numbers[0] > 50) {
push (@array,$numbers[0]) }
if ($numbers[1] > 50) {
...
push (@array,$numbers[2]) }
if ($numbers[3] > 50) {
push (@array,$numbers[3]) }
- or download this
$sum += 2;
push(@array,2);
...
push(@array,4);
$sum += 6;
push(@array,6);
- or download this
for (@numbers) {
push @array, $_ if $_ > 50;
}
- or download this
for my $current (@numbers) {
if ($current > 50) {
push @array, $current;
}
}