On Wed, 2007-07-04 at 19:00 +0200, Martin Barth wrote:
> Hi
> 
> > if (($DeviceType eq "Switch") || ($DeviceType eq "Router") ||
> > ($DeviceType eq "Hub") || ($DeviceType eq "Access point"))
> > 
> > 
> > what i would like to do is check each device type with where the first
> > letter is uppercase or lowercase
> 
> this should help:
> 
> if( $DeviceType =~ m/^([Ss]witch|[Rr]outer|[Hh]ub|[Aa]ccess point)$/) { ...

Knowing systems:

if( $DeviceType =~ m/^(switch|router|hub|access point)$/i ) {

The i modifier is ignore case.

I think there is a word boundary \< and \> that might be useful rather
than ^$ as well.

-- 
Ken Foskey
FOSS developer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to