#!/usr/local/bin/perl use feature qw{ switch }; use strict; use warnings; sub match { my $i = 0; my $foo = shift; given ( $foo ) { when ( 1 ) { $i++; continue; } when ( 2 ) { $i++; continue; } when ( 3 ) { $i++; continue; } when ( 4 ) { $i++; } } print "$foo: "; print "4!" if 4 == $i; print "\n"; } match 1; match 2; match 3; match 4; match 5;