Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Less-than-helpful warnings

by Aristotle (Chancellor)
on Dec 11, 2003 at 08:54 UTC ( #314012=note: print w/ replies, xml ) Need Help??


in reply to Less-than-helpful warnings

There is three steps to what happens here: the values from the variables are read, then the various resulting strings are passed to a series of concatenation ops, and finally the result is passed to print.

The existence of a variable is only apparent in step 1, but reading an undefined value from a value is not and should not elicit a warning. During the concatenation step where the undef is encountered and warned about, its relation to a variable is unknown. You could just as well write

print 1 . " " . 2 . " " . 3 . " " . 4 . " " . undef;

From the concatenation operation's point of view, there's no difference to your own code.

While this situation seems trivial to a human, it is decidedly non-trivial to handle; you would need logic close to a generic partial evaluator to solve this matter.

Makeshifts last the longest.


Comment on Re: Less-than-helpful warnings
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-10-01 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (393 votes), past polls