Sha256: d6f7e1e6c7d81d661b4c01ddc25de87a6b10930fbcb4d7a8ecafef42a6e1b71c
Contents?: true
Size: 581 Bytes
Versions: 9
Compression:
Stored size: 581 Bytes
Contents
#!/usr/bin/env perl use v5.10; use warnings; use strict; my $countfile = __FILE__ . '.counter'; my $count = 1 + do { open(my $fh, '<', $countfile) or die "cannot open '$countfile' - $!"; chomp(my $c = <$fh>); $c; }; my %data = map({ my $file = $_; open(my $fh, '<', $file) or die "cannot open '$file' - $!"; chomp(my @lines = <$fh>); $count = 1 if @lines < $count and warn "resetting\n"; ($file => \@lines); } @ARGV); say { open(my $fh, '>', $countfile) or die "cannot open '$countfile' - $!"; $fh } $count; say "$_: $data{$_}[$count - 1]" for keys %data;
Version data entries
9 entries across 9 versions & 1 rubygems