Subject: | path_segments regression in URI 1.64 |
Date: | Fri, 23 Mar 2018 09:40:01 +0000 |
To: | bug-URI [...] rt.cpan.org |
From: | Mark Hindley <mark [...] hindley.org.uk> |
Hello,
I have noticed a change in behaviour in the path_segments method between URI
versions 1.60 and 1.64.
In 1.60, you can erase the path_segments array by passing undef. In 1.64 still
works, but produces unitialised value warnings. Passing the null string instead works
and does not trigger any warnings, but feels the wrong thing to do. Is undef the
'correct' way to do this?
% perl -MURI -e 'print "Perl version $]\nURI version:$URI::VERSION\n"; URI->new("http://localhost")->path_segments(undef)'
Perl version 5.020002
URI version:1.64
Use of uninitialized value $_ in substitution (s///) at /usr/share/perl5/URI/_generic.pm line 107.
Use of uninitialized value $_ in substitution (s///) at /usr/share/perl5/URI/_generic.pm line 107.
Use of uninitialized value $_ in substitution (s///) at /usr/share/perl5/URI/_generic.pm line 109.
Use of uninitialized value $arg[0] in join or string at
/usr/share/perl5/URI/_generic.pm line 111.
But this is OK
% perl -MURI -e 'print "Perl version $]\nURI version:$URI::VERSION\n"; URI->new("http://localhost")->path_segments("")'
Perl version 5.020002
URI version:1.64
On another system I have both of these work without complaint:
% perl -MURI -e 'print "Perl version $]\nURI version:$URI::VERSION\n"; URI->new("http://localhost")->path_segments(undef)'
Perl version 5.014002
URI version:1.60
% perl -MURI -e 'print "Perl version $]\nURI version:$URI::VERSION\n"; URI->new("http://localhost")->path_segments("")'
Perl version 5.014002
URI version:1.60
Let me know if you need anything else
Mark