- or download this
sub set_column_widths {
my $h = shift; # reference to hash table of speeds, keyed
+by datetime, then by database
...
$databases->{$db} = $databases->{$db} > $l ? $databases->{$db}
+ : $l;
}
}
- or download this
set_column_widths(\%h, \%db, \@db);
- or download this
printf "%11s", $_ for (@db);
...
# stick a space between columns
printf " %$db{$_}s", $_ for (@db);
- or download this
#!/usr/bin/env perl
use 5.010; use strict; use warnings;
...
server02: 2015-06-01T12:41:03-04:00 MYDB101 7 MB/sec
server02: 2015-06-01T12:41:03-04:00 MYDB202 7 MB/sec
server02: 2015-06-01T12:41:03-04:00 _OTHER_DB_ 55 MB/sec