use warnings; use strict; use diagnostics; sub foo { last if /e/; next if /c/; redo if s/b/B/ } my @x = qw/a b c d e f/; for (@x) { foo; print "$_\n"; } __END__ a Exiting subroutine via redo at test.pl line 6 (#1) (W exiting) You are exiting a subroutine by unconventional means, such as a goto, or a loop control statement. B Exiting subroutine via next at test.pl line 6 (#1) d Exiting subroutine via last at test.pl line 6 (#1)