Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Detecting if a scalar has a number or string

by mojotoad (Monsignor)
on Nov 17, 2004 at 22:35 UTC ( [id://408636]=note: print w/replies, xml ) Need Help??


in reply to Detecting if a scalar has a number or string

Can you count on stringification to work? So with your overloaded object can you do something like _numberlike("$ref") ?

Matt

  • Comment on Re: Detecting if a scalar has a number or string

Replies are listed 'Best First'.
Re^2: Detecting if a scalar has a number or string
by rrwo (Friar) on Nov 18, 2004 at 18:37 UTC

    Counting on stringification is an interesting idea, but not reliable. Suppose I have a roman numerals class that behaves just like numeric variables, but outputs as roman numerals in string context?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-19 23:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found