Re: unhead

[email protected] (Randal L. Schwartz)
Newsgroups gmane.comp.lang.perl.fun
Organization Stonehenge Consulting Services; Portland, Oregon, USA
Message-ID <[email protected]>
>>>>> "Jose" == Jose Alves de Castro <[email protected]> writes:

Jose> You're probably all familiar with the commands "head" and "tail", which
Jose>  let you extract the first or the last N lines of input or a file...

Jose> Imagine you want to print a file, but without the first N lines...

Jose> For N=1, one possibility would be:

Jose> print if $. - 1;

Jose> For any N, maybe this:

Jose> print if ($N+1)..0;

Jose> Any thoughts? Any other ideas? What would be the best way to do this?

perl -ne 'print unless 1..5'

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.