Just another Perl shrine | |
PerlMonks |
Re: pack() returns an unusable stringby ikegami (Patriarch) |
on May 29, 2021 at 03:08 UTC ( [id://11133245]=note: print w/replies, xml ) | Need Help?? |
Parameters can't contain the NUL character. Your so-called working code breaks if you change 2.4 to 2.5 (which generates at least one a NUL byte). I recommend that you pass the hex of the packed string. You could also use base64, JSON, etc, etc, etc. Furthermore, you have a code-injection bug. "'$p'" is not an appropriate way to generate a Perl string literal. $p could easily contain byte 0x27 (single quote). A trailing byte 0x5C (backslash) would also be problematic. I recommend that you pass the value as an argument.
Seeking work! You can reach me at ikegami@adaelis.com
In Section
Seekers of Perl Wisdom
|
|