in reply to Padding with \s

you could use concatenation ("the dot operator") :
my $crypticString="LR20SR37PD30LR23CR23BT01H"; my $acceptableLength=40; my $paddedString =$crypticString . " " x ($acceptableLength - length ($crypticString)); print "'$paddedString'";
Also, using \s to indicate " " might be confused with the character class \s (which also includes newlines and tabs).