"R. Joseph Newton" wrote:
>
> 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
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 lin
Thanks!
>
> Dan Muey wrote:
> >
> > IS there a better way to perhaps assign the value of $1
> back to $var
> > all in one statement?
>
> Yes.
>
> > EG
> >
> > $var = 'hello.domain.com';
> > # Instead of this ::
> > $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> $var = $1;
>
Dan Muey wrote:
>
> IS there a better way to perhaps assign the value of $1 back to $var all in one
>statement?
Yes.
> 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
>
> --- Dan Muey <[EMAIL PROTECTED]> 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;
> > #
--- Dan Muey <[EMAIL PROTECTED]> 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.c
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