Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: To hex EXPR or 'EXPR' is my question

by biohisham (Priest)
on Nov 07, 2010 at 18:07 UTC ( [id://869932]=note: print w/replies, xml ) Need Help??


in reply to Re: To hex EXPR or 'EXPR' is my question
in thread To hex EXPR or 'EXPR' is my question

Thanks folks, this made me see this confusion under another light, it seems after all that perl interprets EXPR so quickly that both hex and oct become useless anatomical-appendices (metaphorically speaking) if EXPR was passed preceded by '0x' in a string, not trying to make a generalization here rather than a mere observation and not trying to dig myself a hole by including the '0'-preceded EXPRs either (octals may have another behavior I guess), so correct me if I am wrong with regard to the following:
print 0xCA; 202 print hex '0xCA'; #<-- what use does hex have? 202 print oct '0xCA'; #<-- what use does oct have? 202
The issue is, what can be gotten out of this behavior is brain-bombing and to quote EXPR or not warrants someone being absolutely aware of how they're going about it since the docs and faqs are kinda shallow when it comes to making us aware of this..What do you monks think??


Excellence is an Endeavor of Persistence. A Year-Old Monk :D .

Replies are listed 'Best First'.
Re^3: To hex EXPR or 'EXPR' is my question
by BrowserUk (Patriarch) on Nov 07, 2010 at 18:44 UTC

    Interpreting strings that are read from external sources:

    print 'deadbeef';; deadbeef print '0x'.'deadbeef';; 0xdeadbeef print 0+ '0x'.'deadbeef';; Argument "0x" isn't numeric in addition (+) 0deadbeef print hex 'deadbeef';; 3735928559 print '77777777';; 77777777 print '0'.'77777777';; 077777777 print 0+'0'.'77777777';; 077777777 print oct '77777777';; 16777215

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2025-02-16 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found