in reply to sprintf is printing unexepected output

Hi thezip,

I think what's happening is that you have a carriage return character in the file which isn't getting chomped (the chomp is only handling the newline "\n"), so it's displaying when you print $code, and then the other two variables are getting displayed afterwards.

You don't need to do a print of a sprintf, just use printf by itself.

Furthermore, consider using %32.32s instead of %32s, which will force the string to print with a maximum of 32 characters.

Finally, you don't actually need the quotes on "$code" (thought they don't hurt).


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/