use feature qw( switch say ); ## ... as your code ... given( shall_we() ) { when (1) { print "In the 'if' statement: yes, we shall.\n"; } when (0) { print "In the 'if' statement: no, we shant.\n"; } };