programming-examples/perl/Datatype/Hexadecimal and octal numbers.pl

11 lines
223 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#An integer with a leading 0 is treated as an octal number.
#An integer with a leading 0x (or 0X) is a hexadecimal number.
#!/usr/bin/perl -w
$hex = 0xFF;
$octal = 010;
print "0xFF = $hex, 010 = $octal.\n";