You need to import Switch to use it:
use Switch;
However, Switch has been deprecated. See this question: Why is the Switch module deprecated in Perl?
Some alternatives (and their experimental status) are discussed here: http://perldoc.perl.org/perlsyn.html#Switch-Statements
In summary, if you're using Perl >5.10.1, you can use the following for a non-deprecated, non-experimental switch:
use v5.10.1;
for ($var) {
when (/^abc/) { $abc = 1 }
when (/^def/) { $def = 1 }
when (/^xyz/) { $xyz = 1 }
default { $nothing = 1 }
}