File: dump.pl

package info (click to toggle)
libpod-eventual-perl 0.094003-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 208 kB
  • sloc: perl: 281; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 505 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
21
22
23
24
25
26
#!perl
use strict;
use warnings;

our @events;

{
  package Pod::Gather;
  use base 'Pod::Eventual';
  sub handle_event { push @events, $_[1] }
}

use String::Truncate qw(elide);

Pod::Gather->read_file($ARGV[0]);

for my $event (@events) {
  my $content = defined $event->{content} ? $event->{content} : '';
  $content =~ s/\n.*//s;

  printf "%4u: %-10s %-10s %s\n",
    $event->{start_line},
    $event->{type},
    (defined $event->{command} ? $event->{command} : '(n/a)'),
    elide($content, 60);
}