This line of code errors out with “Invalid type ‘t’ in unpack”:
my $x = unpack(chr(ord("a") + 19 + print ""), $string);
It is trying to retrieve the original value of $x that was first transformed this way:
my $string = pack("u",$x);
I can’t find this error anywhere on the internet. I am basically trying to make a simple string obfuscator, that can retrieve the original string.
Function
printreturns false on failure. In numerical context, false values are considered as 0. In your case, the first argument of pack becomes “t” and Perl raises an error.Note that
printcan be failed, typically in case when you didclose STDOUT. In addition,printreturns true on success, not limited to1. There is little possibility of returning2,blah, or any other true values on future versions.