Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yeah, I can see value in getting the binary search to find the "first" potential match; especially how you've avoided using the regex within it. Many decent improvements. bsearch() is still accessing @suff like a global variable. You may have decided that that is fine. I'd rewrite:
as
though not for any compelling reasons. Your bsearch() now returns the first potential match (the first suffix after or equal to your search), so you might want to adjust your output for the case of no matches. The return value from bsearch() might be an error message but you unconditionally use it as a number. If Modern::Perl doesn't turn on warnings, then you should probably do that.
can be shortened as:
- tye In reply to Re^3: searching for a pattern using suffix arrays (better)
by tye
|
|