in reply to Re: Java to perl conversion
in thread Java to perl conversion

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.

This does exactly that.

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 );

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.