Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: hex numbers

by davido (Cardinal)
on Jan 14, 2021 at 17:11 UTC ( #11126919=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $n = 0xDEADBEEF;
    print "$n\n";
    
    # Output:
    # 3735928559
    
  2. or download this
    # This works but is NOT recommended, and can be unsafe.
    my $n = eval "0xDEADBEEF";
    ...
    
    # Output:
    # 3735928559
    
  3. or download this
    my $n = "0xDEADBEEF";
    print "$n\n";
    
    # Output:
    # 0xDEADBEEF
    
  4. or download this
    my $string = "DEADBEEF";
    my $n = hex($string);
    ...
    
    # Output:
    # 3735928559
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11126919]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2021-05-13 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (134 votes). Check out past polls.

    Notices?