Peter/All;
Is this what you had in mind, offered as a suggestion?
if ($test = /($regex)/o) {
SWITCH: for ($test){
if ( $test =~ /Communication/ ) {
$results{$test}++ if ( $_ =~ /$test/ && $_ =~
/failure/);
last SWITCH;
}
....
....
}
}
Regards,
Ron
> -----Original Message-----
> From: Peter Scott [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 14, 2001 16:13
> To: Yacketta, Ronald; Beginners (E-mail)
> Subject: RE: Code for review
>
>
> At 01:38 PM 8/14/01 -0400, Yacketta, Ronald wrote:
>
> > > $regex = 'join ('|', keys %lookFor);
> > > if (/($regex)/o) {
> > > # Now switch on $1 for your specific sub-tests like
> /Factory/ etc
> > > }
> > >
> >
> >could you kindly elaborate some on this part?
> >I thought one could only "switch" on numeric values?
> >
> >switch {
> >case 1:
> >case 2:
> >case 3:
> >default:
> >}
>
> Ooh, that's some other kind of language. No, I meant the
> Perl kind of
> switch, as in
>
> http://www.cpan.org/doc/FMTEYEWTK/switch_statements
>
> Which just means testing $1 against various things the way
> you were doing
> it. Actually, it would be best to save $1 first, so
>
> if (my ($match) = /($regex)/o) {
> # test $match
>
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]