$ perl -wl $str = 'abc'; $str .= 'X' x (10-length($str)); print $str; abcXXXXXXX