ly/Makefile: Sort variables
[sunny256-utils.git] / rmheadtail
blob00894e70af5d6b5ff811ae77c2269c1820e9b3a7
1 #!/usr/bin/env perl
3 #===============================================================
4 # rmheadtail
5 # File ID: 78b00000-5d43-11df-b7a6-90e6ba3022ac
6 # Removes first and last line from stdin or specified files
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 my @Data = <>;
20 if (scalar(@Data) > 2) {
21 splice(@Data, 0, 1);
22 splice(@Data, -1);
23 for (@Data) {
24 print($_);
28 __END__
30 =pod
32 =head1 LICENCE
34 This program is free software; you can redistribute it and/or modify it
35 under the terms of the GNU General Public License as published by the
36 Free Software Foundation; either version 2 of the License, or (at your
37 option) any later version.
39 This program is distributed in the hope that it will be useful, but
40 WITHOUT ANY WARRANTY; without even the implied warranty of
41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
42 See the GNU General Public License for more details.
44 You should have received a copy of the GNU General Public License along
45 with this program; if not, write to the Free Software Foundation, Inc.,
46 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48 =cut
50 # vim: set fileencoding=UTF-8 filetype=perl foldmethod=marker foldlevel=0 :
51 # End of file rmheadtail