/usr/share/doc/libnews-scan-perl/examples/update-posters is in libnews-scan-perl 0.53-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | #! /usr/bin/perl -w
use strict;
use News::Scan;
my %Posters;
$0 =~ s!^.*/!!;
## read in posters we know
if (open OLD, "posters") {
while (<OLD>) {
chomp;
$Posters{$_}++;
}
close OLD;
}
for (@ARGV) {
unless (open SCAN, $_) {
warn "$0: failed open $_: $!\n";
next;
}
local $/;
my $data = <SCAN>;
my $VAR1;
eval $data;
if ($@) {
warn "$0: while evaluating $_: $@\n";
close SCAN;
next;
}
my $p = $VAR1->posters;
unless (ref $p) {
warn "$0: no posters in $_!\n";
close SCAN;
next;
}
for (keys %$p) {
$Posters{$_}++;
}
close SCAN;
}
open OUT, ">posters" or die "$0: failed open >posters: $!\n";
for (sort keys %Posters) {
print OUT "$_\n";
}
|