ly/Makefile: Sort variables
[sunny256-utils.git] / skiptoplines
blob1f3d9c7edd588e30aad5d0266cfa56d8f41fcc1a
1 #!/usr/bin/env perl
3 #===============================================================
4 # skiptoplines
5 # File ID: 025415b2-5d44-11df-8367-90e6ba3022ac
6 # Skips the first N lines from stdin or specified file(s).
8 # Character set: UTF-8
9 # License: GNU General Public License version 2 or later
10 # ©opyleft 2003 Øyvind A. Holm <sunny@sunbase.org>
11 #===============================================================
13 use strict;
14 use warnings;
16 $| = 1;
18 use Getopt::Std;
20 our ($opt_l) = (0);
21 getopts('l:');
23 unless ($opt_l) {
24 usage(1);
27 for (my $Count = $opt_l; $Count; $Count--) {
28 <>;
31 while (<>) {
32 print;
35 sub usage {
36 my $Retval = shift;
37 print <<END;
39 Syntax: $0 -l lines
41 END
42 exit($Retval);
45 __END__
47 =pod
49 =head1 LICENCE
51 This program is free software; you can redistribute it and/or modify it
52 under the terms of the GNU General Public License as published by the
53 Free Software Foundation; either version 2 of the License, or (at your
54 option) any later version.
56 This program is distributed in the hope that it will be useful, but
57 WITHOUT ANY WARRANTY; without even the implied warranty of
58 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
59 See the GNU General Public License for more details.
61 You should have received a copy of the GNU General Public License along
62 with this program; if not, write to the Free Software Foundation, Inc.,
63 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
65 =cut
67 # vim: set fileencoding=UTF-8 filetype=perl foldmethod=marker foldlevel=0 :
68 # End of file skiptoplines