#!/usr/bin/perl use strict; use warnings; for(0..9) { eval{ die 7 if $_ == 7; print $_,"\n"; } or do{ next; }; }