the part that i need a bit help with:
Looking again, I'm wrong! The string/array isn't null padded, but rather padded with bytes equivalent to their position.
But you will need to understand that Java's byte arrays and Perl's scalars (when they contain strings) are effectively equivalent.
So, use:
my $string = "just a bunch of text"; $string .= pack 'C*', length( $string ) .. 255; my $md5 = md5( $string );
In reply to Re^2: Java to perl conversion (Updated)
by BrowserUk
in thread Java to perl conversion
by MaGiCaLB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |