On 5/29/03 at 2:15 PM, [EMAIL PROTECTED] (Peter Fleck) wrote:

> I'm getting this error (warning?) in my Apache error log:
> 
> Use of uninitialized value in string ne
> 
> Here's the offending line.
> 
> if ($titlelink ne undef)
> 
> I tried initializing at the beginning of the script with
> 
> $titlelink = "";
> 
> but I think a subsequent call to a mysql database is then 
> unitializing the scalar when no data flows in.
> 
> I'd like to stop the error messages even though they don't seem to 
> matter. I don't like unnecessary clutter in my error logs.
> 
> Thanks.

I believe the 'use warnings' pragma is lexically scoped so you can turn
it off withing say a block of code with 'no warnings;'

consider:

#!/usr/bin/perl
#File:

use warnings;

use strict;

my $var;

{
#I know this may be undef!
no strict;
no warnings;
print $bar
}

print $var;


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

Reply via email to