Re: match and putting in a variable with a single statement

2008-10-27 Thread John W. Krahn
Jenda Krynicky wrote: From: "Chas. Owens" <[EMAIL PROTECTED]> On Oct 24, 2008, at 11:00, "Sharan Basappa" <[EMAIL PROTECTED]> wrote: I was just trying to match a string and save it in a single statement as follows: $extracted = "cp xyz"; $state_var = $extracted =~ m/cp\s+(.*)/; print "$state

Re: match and putting in a variable with a single statement

2008-10-27 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > On Oct 24, 2008, at 11:00, "Sharan Basappa" <[EMAIL PROTECTED]> > wrote: > > > Hi, > > > > I was just trying to match a string and save it in a single statement > > as follows: > > > > $extracted = "cp xyz"; > > $state_var = $extracted =~ m/cp\s+(.*)/; >

Re: match and putting in a variable with a single statement

2008-10-24 Thread Bryan R Harris
> On Fri, Oct 24, 2008 at 8:42 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: >> >> >> On Oct 24, 2008, at 11:00, "Sharan Basappa" <[EMAIL PROTECTED]> >> wrote: >> >>> Hi, >>> >>> I was just trying to match a string and save it in a single statement >>> as follows: >>> >>> $extracted = "cp xyz";

Re: match and putting in a variable with a single statement

2008-10-24 Thread Lawrence Statton
> > I was just trying to match a string and save it in a single statement > as follows: > > $extracted = "cp xyz"; > $state_var = $extracted =~ m/cp\s+(.*)/; > print "$state_var $1 \n"; > > The output is: 1 xyz > > So the assignment to $state_var does not work. Is this an incorrect way. > The

Re: match and putting in a variable with a single statement

2008-10-24 Thread Sharan Basappa
On Fri, Oct 24, 2008 at 8:42 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > > On Oct 24, 2008, at 11:00, "Sharan Basappa" <[EMAIL PROTECTED]> > wrote: > >> Hi, >> >> I was just trying to match a string and save it in a single statement >> as follows: >> >> $extracted = "cp xyz"; >> $state_var = $ex

Re: match and putting in a variable with a single statement

2008-10-24 Thread Chas. Owens
On Oct 24, 2008, at 11:00, "Sharan Basappa" <[EMAIL PROTECTED]> wrote: Hi, I was just trying to match a string and save it in a single statement as follows: $extracted = "cp xyz"; $state_var = $extracted =~ m/cp\s+(.*)/; print "$state_var $1 \n"; The output is: 1 xyz So the assignment t

Re: match and putting in a variable with a single statement

2008-10-24 Thread Rob Coops
On Fri, Oct 24, 2008 at 5:00 PM, Sharan Basappa <[EMAIL PROTECTED]>wrote: > Hi, > > I was just trying to match a string and save it in a single statement > as follows: > > $extracted = "cp xyz"; > $state_var = $extracted =~ m/cp\s+(.*)/; > print "$state_var $1 \n"; > > The output is: 1 xyz > > So

match and putting in a variable with a single statement

2008-10-24 Thread Sharan Basappa
Hi, I was just trying to match a string and save it in a single statement as follows: $extracted = "cp xyz"; $state_var = $extracted =~ m/cp\s+(.*)/; print "$state_var $1 \n"; The output is: 1 xyz So the assignment to $state_var does not work. Is this an incorrect way. Regards -- To unsubscr