Hi
On 18/12/12 19:00, Henrik Hald Nørgaard via RT wrote:
Show quoted text> Queue: Set-Array
> Ticket<URL:
https://rt.cpan.org/Ticket/Display.html?id=81971>
>
> Hi
>
> Thank you for fixing this problem very fast.
>
> In index and rindex shouldn't you use /^\Q$value\E$/? These methods are now testing if the value is a suffix of a member of the list.
Yes, you're right again! I've uploaded V 0.28 to CPAN.
Thanx.
Show quoted text> Example:
>
> perl -E 'use Set::Array; my $set = Set::Array->new("dog", "horse", "cat"); say $set->index("at");'
>
> which prints "2".
>
> Kind regards
>
> Henrik Hald Nørgaard, Programmør
> Jobindex A/S, Holger Danskes Vej 91, 2000 Frederiksberg
> Tlf.: +45 38 32 33 55, dir.: +45 38 32 33 81
>
> www.jobindex.dk
>
> -----Oprindelig meddelelse-----
> Fra: RSAVAGE via RT [mailto:bug-Set-Array@rt.cpan.org]
> Sendt: 14. december 2012 23:20
> Til: henrik@jobindex.dk
> Emne: [rt.cpan.org #81971] Delete and quoting
>
> <URL:
https://rt.cpan.org/Ticket/Display.html?id=81971>
>
> Hi
>
> Yes, you're right.
>
> I've uploaded V 0.27 to CPAN. Here is the new part of the CHANGES file:
>
> 0.27 Sat Dec 15 07:19:00 2012
>
> - Fix RT#81971, kindly reported by Henrik Hald Nørgaard.
> When special chars, as used in regexps, are set members, or used to find set members, they must be quoted with \Q$value\E inside regexps.
> This fix was applied to count(), delete(), exists(), index() and rindex().
>
> - Add t/rt.81971.t to exercise the new code.
>
> - While examining the code for this fix, I found a couple of other bugs:
> In index() and rindex(), the value searched for was compared with each set member using this regexp, /$value/, instead of this regexp, /$value$/. The missing, trailing, $ meant that the member could match just the prefix of $value, rather than match the value exactly. So in those 2 methods the tests are now /\Q$value\E$/. The other 3 methods mentioned above already used /$value$/.
>
>
> Thanx for the report.
>
>
>
--
Ron Savage
http://savage.net.au/
Ph: 0421 920 622