Switch.pm

josh hoblitt jhoblitt at mysun.com
Thu Jul 11 16:06:10 CDT 2002


I'm trying to do some regex matching with switch then use part of the
match in the action taken but it seems the values aren't being passed.

switch ($mystr) {
    case /^(somevalue)$/m { print "$_ $1\n"; }
    .
    .
    .
}

The cases are getting matching correctly but both $1 and $_ seem to be
empty... I suspect whats going on is that the regex is getting placed in
a sub and then being called (haven't looked at the code for Switch.pm).
 Is there syntax that will work for me here?

Thanks,

-Joshua Hoblitt

--
jhoblitt at mysun.com

TIMTOWTDI



More information about the Pdx-pm-list mailing list