On Wed, Mar 07, 2007 at 09:18:52AM -0800, Paul G. Allen wrote:
> It's been a while (years?) since I've done anything in Perl. I need to
> convert an ASCII string of ones and zeros to a double. (Actually, I
> don't need to, but one of our engineers does.)
> 
> So, which one of the many possible ways to do it in Perl should I use
> (put another way, please provide suggestions and I'll pick one,
> because in Perl "There's more than one way to do it." :) )
> 
> If I have "10110111100011", the output should be 11,747.

$foo = '10110111100011';
$bar = eval "0b$foo";
print "$bar\n";    # prints 11747

-- 
Chris Grau

Attachment: pgpNeOKMMzlV9.pgp
Description: PGP signature

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to