- or download this
push @array, ('@', '@') if scalar(@array) < 10;
splice @array, -2, 2 if scalar(@array) >= 10;
- or download this
use strict;
use warnings;
...
$str .= "@@" if length ($str) < 10;
substr $str, -2, 2, '' if length ($str) > 10;
}
- or download this
my $newStr = autoformat ($str, { justify => 'center' });
print "$newStr\n";