libwww-perl / URI

The Perl URI module
https://metacpan.org/pod/URI
Other
57 stars 48 forks source link

Bareword "URI::HAS_RESERVED_SQUARE_BRACKETS" not allowed while "strict subs" in use #120

Closed charsbar closed 1 year ago

charsbar commented 1 year ago
$ perl -E 'eval qq{require "./local/lib/perl5/URI/_generic.pm"} or die $@'
Bareword "URI::HAS_RESERVED_SQUARE_BRACKETS" not allowed while "strict subs" in use at ./local/lib/perl5/URI/_generic.pm line 13.
Compilation failed in require at (eval 1) line 1.
haarg commented 1 year ago

You are loading URI::_generic from a location that isn't in @INC, so the URI.pm it loads is from a different version. This is not a bug in the module.

charsbar commented 1 year ago

Thanks. That makes sense. I got a report from my colleague who encountered this issue by starman -M(several modules). We should add -I local/lib/perl5 so that all the modules are loaded from there.

distler commented 2 months ago

Shouldn't it be $URI::HAS_RESERVED_SQUARE_BRACKETS, not URI::HAS_RESERVED_SQUARE_BRACKETS (twice in _server.pm and once in _generic.pm)?

At least Perl 5.34 seems to think so.

haarg commented 2 months ago

No, HAS_RESERVED_SQUARE_BRACKETS is a constant, not a variable.

distler commented 2 months ago

Ack! Sorry, my bad.