#!/usr/bin/perl use feature qw(switch); given ($x) { when ('a') { print "x zawiera $x"; } when ('b') { print "x zawiera $x"; } default { print 'x zawiera zupelnie cos innego niz a lub b' } }