in reply to no warnings 'uninitialized' (was:Time to seconds)
in thread Time to seconds
Because using undef in a math operation is generally a Weird Thing, and by turning on warnings you've asked Perl to warn you about Weird Things.
If the first one gives me a "Use of uninitialized value in multiplication" error, why wouldn't this give me a "Use of uninitialized value in logical OR" error?
The reason is that logical or is often used as a defaulting operator. That idiom--$foo||$default--is so common that it's getting its own syntax in Perl 6--the new // defaulting operator, which only returns the right operand if the left operand is undefined. With this addition to Perl 6 perhaps the warning you mention will appear.
PS Sorry if this has the tone of lashing out angrily at you or something. It's probably too late for me to be safely posting to the Monastery anyway... :^)
=cut
--Brent Dax
There is no sig.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: no warnings 'uninitialized' (was:Time to seconds)
by blakem (Monsignor) on Nov 16, 2001 at 16:25 UTC | |
by Anonymous Monk on Nov 16, 2001 at 23:03 UTC | |
by blakem (Monsignor) on Nov 17, 2001 at 00:53 UTC |