taj_ritesh has asked for the wisdom of the Perl Monks concerning the following question:
But it is printing all the lines..#!/usr/bin/perl use strict; my $i = 1; while (<>) { if (/Startpoint/ ... /slack/ && $i < 2 ) { print $_; $i++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to print lines between two patern only one time, not multiple timese as pattern exists in this file multiple times.
by choroba (Cardinal) on Apr 14, 2014 at 07:56 UTC | |
|
Re: How to print lines between two patern only one time, not multiple timese as pattern exists in this file multiple times.
by Laurent_R (Canon) on Apr 14, 2014 at 09:33 UTC |