File: generate2.pl

package info (click to toggle)
newsbeuter 2.9-5+deb9u2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 4,692 kB
  • ctags: 3,693
  • sloc: cpp: 18,663; ruby: 1,797; xml: 350; sh: 199; makefile: 171; perl: 101
file content (18 lines) | stat: -rwxr-xr-x 350 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w

use strict;

if (scalar(@ARGV) < 1) {
	print STDERR "usage: $0 <dsv-file>\n";
	exit(1);
}

open(my $fh, '<', $ARGV[0]) or die "couldn't open $ARGV[0]: $!\n";

while (my $line = <$fh>) {
	chomp($line);
	my @fields = split(/:/, $line, 3);
	print "'$fields[0]' (default key: '$fields[1]')::\n         $fields[2]\n\n";
}

close($fh);