uninitialized value in pattern match

G

gilgames

#!/usr/bin/perl

use warnings;
use strict "refs";
use strict "subs";
use strict "vars";

our $netscape;

$netscape = ($ENV{HTTP_USER_AGENT} =~ /netscape/i ) ? 1 : 0;

################################
The compileing reports an

uninitialized value in pattern match (m//) at a.pl line 10

In the real program I got about 20 similar errors if I use warnings
option. All I want here to check if the string "netscape" matches the
environment variable or not. I use the

our $netscape;

line to avoid the only once error, but if I omit it does not makes any
difference. Also the

use warnings

line is itself is enough to generate the warning.
Could somebody help me, what is wrong and how can I avoid such
messages.

I use perl v5.6.1 for MSWin32-386-Multithread

Activestate version
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top