"David T-G" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

> Hmmm...  Well, I'll grant you that, but what about the example above?  It
> would only be undef for the first N lines that are short, and once it
> gets loaded then it will get reset instead.  It seems more sensible to
> set it to a defined but appropriate value for the upcoming loop than to
> integrate single-case undef logic into the loop, no?

I wouldnt think.... define "appropriate value"....

But I think what you mean by "appropriate value" here is one that wont
generate a warning when the line of code is executed.....

use:

if ( defined($track) and ($track eq "foo") ) { .....

a little more to type, but I like to see it in my code because it reminds me
that $track may somehow or another be undefined.

Alternately, you could say:

$track ||= '';

right before the next time you use foo after the split. I dont know why this
works offhand, I just remember reading in the docs somewhere that its exempt
from warnings. But for me, that is crossing over into the land of ugly =0).

Todd W




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to