Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Amusing Ordity: Ord Range Behavior

by kcott (Archbishop)
on Aug 06, 2013 at 10:42 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1048086]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found