#!/usr/bin/perl -w use strict; my @array = (1..15); print "Numbers are ",join(", ",@array),"\n"; foreach(@array){ next if $_ % 2; # Skip odd numbers. last if $_ > 10; # Exit loop prematurely. $_ = $_ * 2; } print "Numbers now ",join(", ",@array),"\n";