Push value to an array
@a = (1 .. 10); foreach (@a) { if ($_ > 5) { push @b, $_ } }; print join(", ", @b);