okay, number lesson. i'll just be as thourough as i can.
you understanding of binary is correct. every subsequent digit is a factor of two greater. you can convert any number into a binary number, it just gets longer.
all the other number systems work exactly the same. in octal, every digit is x8 more, hexadecimal is x16 more. hence the name "base 8" or "base 16". or, our normal decimal system is "base 10".
now, the computer ultimately has everything stored as a binary number. people don't always work best with binary numbers. it works okay for, say, the permissions on a file, because we can envision bits being turned off and on. however, big numbers turn into really long strings of 1's and 0's that are hard to understand. that's where octal and hexadecimal become useful. because both 8 and 16 are powers of 2, the conversion from binary still leaves alot of the visialization intact. you map any one digit from octal onto 3 digits of binary. for every digit in hexadecimal, there are 4 digits of binary. but, since the number is then greatly compacted, it's alot easier to work with for a human brain and for fingers to type. that's why permissions on files are usual done with octal. 0644 is really just 110100100, but it's easier use as octal. notice that you can clearly see how 6-4-4 is turned into 110-100-100...
really, it doesn't matter what base you use, as long as it represents the correct number and gets used correctly. also, you can put as many zeros in front of a number, and it won't make a bit of difference. 000001 is the same as 1 (as long as they're both in the same number system).
convention has it that characters are usually represented as either octal or hexadecimal numbers. with regular expressions, the escape sequence "\###" is the character represented by that octal number. "\x##" is the same for hexidecimal. however, there's no system to do a decimal escape sequence.
in general, here's how you tell them apart:
octal numbers start with a zero.
decimal numbers are normal.
hexadecimal numbers start with a '0x' or '0X'.
oh, and one last thing. here's how you count in hexadecimal (assume a '0x'):[tt]
1 2 3 4 5 6 7 8 9 A B C D E F 10
11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20
...
A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0
...
F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF 100[/tt]
as you can see, 10(decimal) is 0xA in hexadecimal, 11 is 0xB, 12 is 0xC, 13 is 0xD, 14 is 0xE, 15 is 0xF, and 16 is 0x10. 256 (16x16) is 0x100.
in perl, as long as you write a number in the way it should be written, it usually gets interpreted into the right number system.
HTH "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."