in reply to BIN to HEX
You could first open the file, then read the byte in from the file handle, then inspect the byte.
# open a file open MYFILE, '<myfile.bin' or die 'can not open file'; # read a byte my $byte; read MYFILE, $byte, 1; # do perldoc -f read to see full doco # check the byte if ($byte > 0x30) { print "Byte is greater than 0x30\n"; } else { print "Byte is less than or equal to 0x30\n"; } # close the file close MYFILE;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: BIN to HEX
by eyepopslikeamosquito (Archbishop) on Aug 22, 2006 at 11:26 UTC | |
Re^2: BIN to HEX
by betterworld (Curate) on Aug 22, 2006 at 11:15 UTC |
In Section
Seekers of Perl Wisdom