use strict; use warnings; use utf8; my $input = ; my $str = ""; chomp $input; my $length = length $input; if ($length == 2) { $str = "0" . $input; } elsif ($length == 1) { $str = "00" . $input; } else { $str = $input; } print "$str\n";