Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Changing a number to a string

by jepri (Parson)
on Jan 25, 2001 at 22:14 UTC ( [id://54311]=note: print w/replies, xml ) Need Help??


in reply to Changing a number to a string

You don't have to worry about that, Perl does it for you.
If you use a numerical compare:

if ($var == 0 )
it'll be a number.

If you use a string compare:

if ($var eq "0")
then it'll be a string.

This actually took me quite a long time to get the hang of, sadly.

____________________
Jeremy
I didn't believe in evil until I dated it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found