You may want to chomp the line to remove the newline character.
After' my $line = $_;' add:
chomp $line;
On Wed, Dec 9, 2009 at 10:16 PM, Majian wrote:
> Hi ,all :
>
> I'd like to convert binary file intohex , but when I use perl's built
> in functions I keep getting extra bits on the end
Hi ,all :
I'd like to convert binary file intohex , but when I use perl's built
in functions I keep getting extra bits on the end.
cat bin_file
11100010
0001010100111110
My perl script is the following :
#!/usr/bin/perl
use strict;
while (<>){