Re: reference noob

2011-02-03 Thread Uri Guttman
> "PK" == Parag Kalra writes: PK> print "$field\n" what would that supposedly do to help with the question? and please bottom post. this is a good example. your one line of code should be BELOW the code it replaces or purports to fix. thanx, uri -- Uri Guttman -- u...@stemsyst

Re: reference noob

2011-02-03 Thread Jim Gibson
On 2/3/11 Thu Feb 3, 2011 5:05 AM, "Téssio Fechine" scribbled: > The program: > -- > #use strict; > use warnings; > > my $field = shift @ARGV; > my $regex = '(\w+)\s*' x $field; > > while () { > if (/$regex/) { > print "$$field\n"; # refers to a match variable > } > } > -- > > Example Usage:

Re: reference noob

2011-02-03 Thread Parag Kalra
print "$field\n" ~Parag 2011/2/3 Téssio Fechine > The program: > -- > #use strict; > use warnings; > > my $field = shift @ARGV; > my $regex = '(\w+)\s*' x $field; > > while () { >if (/$regex/) { >print "$$field\n"; # refers to a match variable >} > } > --

Re: reference noob

2011-02-03 Thread Uri Guttman
> "TF" == Téssio Fechine writes: TF> The program: TF> -- TF> #use strict; TF> use warnings; TF> my $field = shift @ARGV; TF> my $regex = '(\w+)\s*' x $field; TF> while () { TF> if (/$regex/) { TF> print "$$field\n"; # refers to a match variable TF> }

Re: reference noob

2011-02-03 Thread Shawn H Corey
On 11-02-03 08:05 AM, Téssio Fechine wrote: The program: -- #use strict; use warnings; my $field = shift @ARGV; my $regex = '(\w+)\s*' x $field; while () { if (/$regex/) { print "$$field\n";# refers to a match variable } } -- Example Usage: -- $ echo 'Strang