my $prev_date; if ( $prev_date ne 'foo' ) { ## LINE 28 ## print 'foo'; }
Since prev_date does not have value, it cannot be compared without raising a warning. On the second pass $prev_date has a value.
Isn't $prev_date assigned to '', and isn't that
It is if you do
my $prev_date = '';
but
my $prev_date;
it is "uninitialized" as in it hasn't been assigned any value incuding "empty"
Compare perl -mstrict -we 'my $v;for(1..3) { print "$v\n";$v++; }' with perl -mstrict -we 'my $v = "";for(1..3) { print "$v\n";$v++; }'
Its kind of like the difference in SQL with an empty value and a NULL value.
HTH :)
Lee.M - JupiterHost.Net
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>