Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: hex numbers

by davido (Cardinal)
on Jan 14, 2021 at 17:11 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11126919]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found