mpatharkar has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl open (RD, "pick no.txt") or die"Could not open file"; @Read = <RD>; close (RD); open (WR1, ">>Numbers.txt") or die"Could not open file"; for ($i=0; $i<= $#Read; $i++) { if($Read[$i] =~/^Number:/and $Read[$i+1]=~/(\w\w\w\w\w\w-\d\d\d\d-\d\ +d\d\d)/) { $Number = $1; $Number1 = substr ($Number, 7, 9); print "$Number1\n"; print WR1"$Number1\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to search a pattern occured more than once in line
by moritz (Cardinal) on Jan 29, 2008 at 07:45 UTC | |
|
Re: how to search a pattern occured more than once in line
by svenXY (Deacon) on Jan 29, 2008 at 07:58 UTC | |
|
Re: how to search a pattern occured more than once in line
by parv (Parson) on Jan 29, 2008 at 07:49 UTC |