taint has asked for the wisdom of the Perl Monks concerning the following question:
The line in question (with fuller context):Use of uninitialized value $ENV{"PATH_INFO"} in pattern match (m//) at + Forum.pm line 674
While I could imagine picking an unlikely to be used name, and declare/assign it to ($ENV{PATH_INFO}...) It seems that that environment variable should already exist -- I haven't had trouble(s) in the past with it.if (not $rm or $rm eq "home") { if ($ENV{PATH_INFO} =~m{^/ # Line 674 ([^/]+) # first word till after the first / (?:/(.*))? # the rest, after the (optional) second / }x) { my $newrm = $1; my $params = $2 || ""; if (grep {$newrm eq $_} @urls) { my @params = split /\//, $params; $self->param(path_parameters => @params ? \@params : []); $rm = $newrm; $self->prerun_mode($rm); } elsif ($ENV{PATH_INFO} eq "/cgi/index.pl") { # TODO this is temporary to avoid unnecessary warnings } else { warn "Invalid PATH_INFO: $ENV{PATH_INFO}"; # shall I make more noise ? } } }
#!/usr/bin/perl -Tw use perl::always; my $perl_version = "5.12.5"; print $perl_version;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CPAN-Forum -- problem with "Use of uninitialized value"
by taint (Chaplain) on Oct 01, 2013 at 23:04 UTC | |
by taint (Chaplain) on Oct 02, 2013 at 00:38 UTC |