# 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;
In reply to Re: BIN to HEX
by Roger
in thread BIN to HEX
by drip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |