On Tue, Jul 21, 2020 at 3:12 PM Edgar Pettijohn
wrote:
> I was playing around with the hex function in perl. So naturally I
> started with:
>
> perldoc -f hex
>
> Which showed me a few examples namely the following:
>
> print hex '0xAf'; # prints '175'
> print hex 'aF'; # same
>
I realized after the fact, that looking at some of the different ways
you can write numbers in perl.
$n = 1234; # decimal integer
$n = 0b1110011; # binary integer
$n = 01234; # octal integer
$n = 0x1234;# hexadecimal integer
$n = 12.
On Tue, Jul 21, 2020 at 07:10:34PM -0500, Edgar Pettijohn wrote:
> I was playing around with the hex function in perl. So naturally I
> started with:
>
> perldoc -f hex
>
> Which showed me a few examples namely the following:
>
> print hex '0xAf'; # prints '175'
> print hex 'aF'; #
I was playing around with the hex function in perl. So naturally I
started with:
perldoc -f hex
Which showed me a few examples namely the following:
print hex '0xAf'; # prints '175'
print hex 'aF'; # same
$valid_input =~ /\A(?:0?[xX])?(?:_?[0-9a-fA-F])*\z/
However, I g
4 matches
Mail list logo