mirror of
https://github.com/erkin/ponysay
synced 2024-11-27 22:00:29 +00:00
The rewrite of ponysaylist.pl does not fail anymore with no parameters.
This commit is contained in:
parent
0923d3c727
commit
df1712c17c
1 changed files with 2 additions and 2 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in a new issue