"/tmp/g1h9LTLH5h" [readonly] 24L, 522Cnigel@freud:~$ cat /usr/local/bin/puppetwhen#!/usr/bin/perl use strict; use warnings; use YAML; use Date::Parse; my %nodes; foreach my $file ( glob '/var/lib/puppet/yaml/facts/*.yaml' ) { my $data = YAML::LoadFile($file);my $name = $data->{name}; my $age = time - str2time($data->{version}); $age = int($age/60 + 0.5);$nodes{$name} = $age; } my @sorted = sort { $nodes{$a} <=> $nodes{$b} } keys %nodes; foreach my $key (@sorted) { printf("%5d minutes ago: %s\n", $nodes{$key}, $key);:let perl_include_pod=1 :let b:is_bash=1 :filetype on  :source /usr/share/perl5/Text/VimColor/mark.vim Error detected while processing /usr/share/perl5/Text/VimColor/mark.vim: line 64:W10: Warning: Changing a readonly file Press ENTER or type command to continue:write! /tmp/55XUkXKVn6 "/tmp/55XUkXKVn6" 24L, 660C written Press ENTER or type command to continue:qall! HTTP/1.1 200 OK Date: Tue, 06 Jan 2009 07:08:33 GMT Server: Apache/2.2.3 (Debian) DAV/2 PHP/5.2.0-8+etch13 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.8.8 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 7c2 [untitled]
nigel@freud:~$ cat /usr/local/bin/puppetwhen 
#!/usr/bin/perl

use strict;
use warnings;

use YAML;
use Date::Parse;

my %nodes;
foreach my $file ( glob '/var/lib/puppet/yaml/facts/*.yaml' ) {
    my $data = YAML::LoadFile($file);

    my $name = $data->{name};
    my $age = time - str2time($data->{version});
    $age = int($age/60 + 0.5);

    $nodes{$name} = $age;
}  

my @sorted = sort { $nodes{$a} <=> $nodes{$b} } keys %nodes;
foreach my $key (@sorted) {
    printf("%5d minutes ago: %s\n", $nodes{$key}, $key);
}
0