Dan Muey wrote: > IS there a better way to perhaps assign the value of $1 back to $var all in one >statement? > EG > > $var = 'hello.domain.com'; > # Instead of this :: > $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com' > $var = $1; # then $var becomes 'domain.com' > # Perhaps a one liner version? > > I know there's a way but it's Monday :( > > Thanks > > Dan
Wouldn't the substitution operator do what you are trying to do here? $var =~ s/.*((\w+)\.(\w+)$)/$1/; Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]