File: head.pl

package info (click to toggle)
pmtools 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 388 kB
  • sloc: perl: 803; makefile: 10
file content (20 lines) | stat: -rwxr-xr-x 275 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl
# head(1) utility for testing

# ------ pragmas
use warnings;
use strict;

# ------ define variables
my $count = 0;		# line count
my $line  = undef;	# current input line

while ($line = <>) {
	if (++$count < 100) {
		print $line;

		next;
	}

	exit(0);
}