programming-examples/perl/Datatype/Hexadecimal and octal numbers.pl
2019-11-15 12:59:38 +01:00

11 lines
223 B
Perl

#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";