Vineet Pande wrote:
> Hi:

Hello,

> In the following perl script, I would like to print all the lines in a
> file (mdout_short.txt) to temp.txt which have "NSTEP" as a word:
> 
> ************************************************
> use strict;
> use warnings;
> 
> my $mdout_file = "mdout_short.txt";
> 
> my $mdout_xtemp_file = "temp.txt";
> 
> 
> open IN, $mdout_file or die;
> open OUT, ">> $mdout_xtemp_file" or die;
> 
> 
> while (<IN>)
> 
>                       {
> 
>                   print OUT ( $_ =~ ( / NSTEP/ ))
> 
>                       }
> 
> ************************************************************
> But this just prints
> ......
> i mean only "6 dots" for six occurences/ matches. How can I get the
> "physical" lines printed rather than these dots?

while ( <IN> ) {
    print OUT if / NSTEP/;
    }



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to