Re: URI.pm error

Gisle Aas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
Nigel Horne <[email protected]> writes:

> Gisle Aas wrote:
> > Nigel Horne <[email protected]> writes:
> >
> >>What are the circumstances under which this error appears, and what
> >>can be done to avoid it?
> >>
> >>"Use of uninitialized value in substitution iterator at /usr/share/perl5/URI.pm line 76."
> > What kind of statement do you find at this line?  What version of
> > URI.pm do you have installed?
> 
> Man URI doesn't tell you the version, but running 'r' within CPAN shows
> no updates available, so I must presume it is the most up to date
> version.

You could run 'grep VERSION /usr/share/perl5/URI.pm' to get the
version number out of the file.  If you have the same version as me
you will find:

  $ perl -ne 'print if 72..76' /usr/share/perl5/URI.pm
  sub _init
  {
      my $class = shift;
      my($str, $scheme) = @_;
      $str =~ s/([^$uric\#])/$URI::Escape::escapes{$1}/go;

so the warning means that perl finds characters in your URI that does
not have corresponding entries in %URI::Escape::escapes.  Hmm, I guess
that can happen if you feed it strings with Unicode chars outside the
Latin 1 range.  Can that be the case?

--Gisle
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.