Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 browsing the Monastery: (5)
As of 2015-07-05 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls