Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Amusing Ordity: Ord Range Behavior

by kcott (Abbot)
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2014-10-30 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls