Re: Using match variable

2008-08-19 Thread Xavier Mas
El Tuesday 19 August 2008 21:15:27 Dr.Ruud va escriure: > Xavier Mas schreef: > > Dr.Ruud: > >> Xavier Mas: > >>> m#(pattern)#; > >>> $variable= $1.; > >> > >> That can be written as: > >> ($variable) = /(pattern)/; > > > > Thank you for pointing that, Dr. Ruud but, what does mean > > ($variable)

Re: Using match variable

2008-08-19 Thread Dr.Ruud
Orson schreef: > Dr.Ruud: >> my $digit = q{\d}; >> my $wsp = q{\s}; >> >> my $pt = qr{ $digit $wsp $digit }x; >> print $pt; > > But once I get it in variable $pt, what syntax to use > for the if (/$pt/) statemet? That syntax is ok. Again: read the documentation of qr. -- Affijn, Ruud "Gewo

Re: Using match variable

2008-08-19 Thread Dr.Ruud
Xavier Mas schreef: > Dr.Ruud: >> Xavier Mas: >>> m#(pattern)#; >>> $variable= $1.; >> >> That can be written as: >> ($variable) = /(pattern)/; > > Thank you for pointing that, Dr. Ruud but, what does mean > ($variable)?. /(pattern1).*?(pattern2)/ returns the matches in list context, and the

Re: Using match variable

2008-08-19 Thread Orson
On Aug 19, 3:27 am, [EMAIL PROTECTED] (Dr.Ruud) wrote: > Orson schreef: > > > what I need is construct a reg ex pattern and store > > in variable. I need to concatenate this from many other variables. > > Then I must use this variable to do a match. Something like this: > > while (<>) > > { > >    

Re: Using match variable

2008-08-19 Thread Xavier Mas
El Tuesday 19 August 2008 10:32:58 Dr.Ruud va escriure: > Xavier Mas schreef: > > m#(pattern)#; > > $variable= $1.; > > That can be written as: > > ($variable) = /(pattern)/; > > -- > Affijn, Ruud > > "Gewoon is een tijger." Thank you for pointing that, Dr. Ruud but, what does mean ($variable)?.

Re: Using match variable

2008-08-19 Thread Dr.Ruud
Xavier Mas schreef: > m#(pattern)#; > $variable= $1.; That can be written as: ($variable) = /(pattern)/; -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Using match variable

2008-08-19 Thread Xavier Mas
El Tuesday 19 August 2008 01:17:59 Orson va escriure: > I need to change perl script, but I am new to perl. Script is too long > to copy here, but what I need is construct a reg ex pattern and store > in variable. I need to concatenate this from many other variables. > Then I must use this variable

Re: Using match variable

2008-08-19 Thread Dr.Ruud
Orson schreef: > what I need is construct a reg ex pattern and store > in variable. I need to concatenate this from many other variables. > Then I must use this variable to do a match. Something like this: > while (<>) > { > chomp; > my $pt = "\d" . "\s" . "\d"; This sets $pt to "dsd".