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]

Reply via email to