in reply to finding length of encrypted(binary) string

Sounds like your binary data is being mistaken for unicode data. Using the bytes pragma, optionally localised around the call to length should fix the problem.

$s = "\x{200}\x{400}\x{301}"; print length $s; 3 print do{ use bytes; length $s }; 6

Examine what is said, not who speaks.
"But you should never overestimate the ingenuity of the sceptics to come up with a counter-argument." -Myles Allen
"Think for yourself!" - Abigail        "Time is a poor substitute for thought"--theorbtwo         "Efficiency is intelligent laziness." -David Dunham
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: finding length of encrypted(binary) string
by linuxfan (Beadle) on Dec 07, 2004 at 23:55 UTC
    Thanks for your reply. I realized I was not using the

    use bytes pragma

    in a different place in the program while extracting the encrypted text, and this was causing my program to fail. My program works like a charm now!