Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: Using "my" suppresses "Name used only once" warning?

by demerphq (Chancellor)
on Feb 03, 2003 at 13:56 UTC ( [id://232235]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Using "my" suppresses "Name used only once" warning?
in thread Using "my" suppresses "Name used only once" warning?

The using a string as a number thing was because I was testing what warnings were given and set a variable to 1 (numeric), concanated it with "1" with the . operand and then added a numeric number 1 to it, without getting any warnings about it.

This seems reasonable to me. Just assume that any time you do math with strings, or string operations with numbers that perl silently handles the type conversions required. So the below

>perl -e "print 1 . '1' + '.01'" 11.01
can be implictily read as
>perl -e "print str2num(num2str(1) . '1') + str2num('.01')"
but is much less confusing.

Dont knock it, eventually youll wonder why it isnt this easy in all of the other languages...

;-)

--- demerphq
my friends call me, usually because I'm late....

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-23 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found