ask_chinna has asked for the wisdom of the Perl Monks concerning the following question:
I have to extract few lines from 16MB file. I wrote a funcion for this purpose.
The starting line looks like this "*|NET min_msb_led[0] 0.0103148PF" and the last line to be extracted is "blank line".
I enter the "min_msb_led[0]" from key board, function returned "/^\*\|NET\smin_msb_led\0\/". It looks ok for me.
Here is some stuff from my main program.
.
.
.
$net_extract = name_modify($net);
.
.
.
ABC: while (<IN1>)
{
#print "entered into while loop\n";
if ($_ =~ $net_extract)
{
$count = 1;
print "hello\n";
}
.
.
.
Its entering into "while" loop but, "if" condition is not
satisfied.
Can any body tell me what is going wrong with this code.
I can use array to read the line and compare with the input,
but this is taking lot of time to execute the code.
Chinna
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can we use variable for pattern match and extraction
by kvale (Monsignor) on Jun 26, 2002 at 19:59 UTC | |
by Rex(Wrecks) (Curate) on Jun 26, 2002 at 20:17 UTC | |
by ask_chinna (Novice) on Jun 26, 2002 at 21:59 UTC |