Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Amusing Ordity: Ord Range Behavior

by kcott (Canon)
on Aug 06, 2013 at 10:42 UTC ( #1048086=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -Mwarnings -E 'say ord("a" .. "g")'
    Argument "a" isn't numeric in range (or flip) at -e line 1.
    ...
    Argument "g" isn't numeric in range (or flop) at -e line 1.
    Use of uninitialized value $. in range (or flop) at -e line 1.
    49
    
  2. or download this
    $ perl -Mwarnings -E 'say("a" .. "g")'
    abcdefg
    
  3. or download this
    $ perl -Mwarnings -E 'say scalar("a" .. "g")'
    Argument "a" isn't numeric in range (or flip) at -e line 1.
    ...
    Argument "g" isn't numeric in range (or flop) at -e line 1.
    Use of uninitialized value $. in range (or flop) at -e line 1.
    1E0
    
  4. or download this
    $ perl -Mwarnings -E 'say int("a")'
    Argument "a" isn't numeric in int at -e line 1.
    0
    
  5. or download this
    $ perl -Mwarnings -E 'say int($.)'
    Use of uninitialized value $. in int at -e line 1.
    0
    
  6. or download this
    $ perl -Mwarnings -E 'say(1E0)'
    1
    
  7. or download this
    $ perl -Mwarnings -E 'say(1 * 10**0)'
    1
    
  8. or download this
    $ perl -Mwarnings -E 'say ord(1)'
    49
    
  9. or download this
    $ perl -Mwarnings -E 'say chr(49)'
    1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048086]
help
Chatterbox?
[ambrus]: 1nickg: obviously the gamers don't know. but anyway, I need the whole room backlit, because watching a monitor in a dark room (like many people do) is tiring for my eyes, even more so than doing it in a lit room.
[1nickt]: ambrus I agree. I suspect one's eyes are always trying to adjust across the boundary between very bright and very dark ... like a camera's autofocus struggling to choose the target.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-27 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.