in reply to Re^2: Convert time string to seconds
in thread Convert time string to seconds

I knew somebody would suggest this method :-)

It's just that when I add code to surpress a warning, "switch off the warning" feels more direct to me than "avoid the warnings".

Since it's not an error, but a warning, using undef as 0 is legitime, and I find avoiding the feature at all rather backwards. After all warnings should help me write better code, not force me to write different application logic.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^4: Convert time string to seconds
by SuicideJunkie (Vicar) on Aug 16, 2010 at 14:17 UTC

    I'm sure there is a place for both.

    In the case of a multiline block, usually there are other variables that you really do want to hear about being undeffed, regardless of the fact that you don't want to hear about a couple specific ones... On the other hand, in a tiny block, typing out the whole no warnings 'uninitialized'; seems excessive.

    For me, at least, the middle ground that calls for "no warnings" is fairly narrow but does exist.