in reply to switch and case statement using a function
sub test_func { print "hello\n"; }
See perlfunc and perlsyn for details.
Oh, and please don't use Switch;, it can go horribly wrong, and is deprecated in favor of given/when, which are available starting from perl 5.10.0 (current old-old release).
|
|---|