<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I have good results using $., the line number of the file being
read.<br>
<br>
perl -ne' next if $. <= 2; printf "%3d - %s". $., $_; ' Build.PL<br>
<br>
perl -MEnglish -ne 'next if $NR <= 2; printf "%3d - %s". $., $_;
' Build.PL<br>
<br>
perl -MEnglish -ne 'next if $INPUT_LINE_NUMBER <= 2; printf "%3d
- %s". $., $_; ' Build.PL<br>
<br>
<br>
skips lines 1 & 2, and outputs the remainder.<br>
<br>
Tom<br>
<br>
<br>
<div class="moz-cite-prefix">On 04/02/2015 11:00 AM, Antonio Sun
wrote:<br>
</div>
<blockquote
cite="mid:CAKczvCZqB8x8iZEe36rWQcDJAD+6yw-aR3d1USj-61ijfPPu8g@mail.gmail.com"
type="cite">
<div dir="ltr">The "-n" causes Perl to assume a loop around the
program, which makes it iterate over filename arguments somewhat
like `sed -n` or awk.
<div><br>
</div>
<div>Now, is it possible to skip some lines myself in such "perl
-wn" script? </div>
<div><br>
</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>
<div>#!/usr/bin/perl -wn</div>
</div>
<div><br>
</div>
<div>if (/my case/) {</div>
<div> # Skip two lines</div>
<div> <>; <>;</div>
<div> # Deal with the rest </div>
<div>}</div>
</blockquote>
<div><br>
</div>
<div>The above is not working for me. $_ is stuck at the same
line/content. </div>
<div><br>
</div>
<div>How to skip some lines in such "perl -wn" script? </div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>Antonio</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
toronto-pm mailing list
<a class="moz-txt-link-abbreviated" href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a>
<a class="moz-txt-link-freetext" href="http://mail.pm.org/mailman/listinfo/toronto-pm">http://mail.pm.org/mailman/listinfo/toronto-pm</a>
</pre>
</blockquote>
<br>
</body>
</html>