But it is printing all the lines..#!/usr/bin/perl use strict; my $i = 1; while (<>) { if (/Startpoint/ ... /slack/ && $i < 2 ) { print $_; $i++; }
In reply to How to print lines between two patern only one time, not multiple timese as pattern exists in this file multiple times. by taj_ritesh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |