aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspider-mario <spidermario@free.fr>2012-07-28 12:20:46 +0200
committerspider-mario <spidermario@free.fr>2012-07-28 12:22:17 +0200
commitdf1712c17c5560143ec64cc0823ffa02fd7561a8 (patch)
tree1377b0b2f3e81c9b7fd73e4edb1a07abdc35fe30
parent0923d3c7274db0f75b9b6fab510513030c254427 (diff)
downloadponysay-df1712c17c5560143ec64cc0823ffa02fd7561a8.tar.gz
ponysay-df1712c17c5560143ec64cc0823ffa02fd7561a8.tar.bz2
ponysay-df1712c17c5560143ec64cc0823ffa02fd7561a8.zip
The rewrite of ponysaylist.pl does not fail anymore with no parameters.
-rwxr-xr-xponysaylist.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/ponysaylist.pl b/ponysaylist.pl
index 0e2db56..0c0410c 100755
--- a/ponysaylist.pl
+++ b/ponysaylist.pl
@@ -16,7 +16,7 @@ use feature qw(say);
use integer;
use List::Util qw(max);
-my $scrw = shift @ARGV;
+my $scrw = shift @ARGV // 1;
for (@ARGV) {
# Format names from ponyies names
@@ -24,7 +24,7 @@ for (@ARGV) {
s/_(.*)/\t($1)/;
}
-my $maxw = max map {length} @ARGV;
+my $maxw = max 1, map {length} @ARGV;
my $cols = max 1, (($scrw + 2) / ($maxw + 2));