Re: convert binary to hex

2009-12-09 Thread Brandon Wood
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

convert binary to hex

2009-12-09 Thread Majian
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 (<>){