in reply to Re: unexpected behavior with split
in thread unexpected behavior with split
ikegami:
Bingo! ...and thank you!
$rest = "\n\t" . $new; #see ikegami's reply; was ". $aphor"
Now I will give both your alt solutions the study they deserve (something, I've been holding off on in hopes I could find my own errors).
I think I understand the underlying difference in approach lies in your design of REMOVING the matches from the front of $new, so each iteration has to start the count at an appropriate point while my
@new = $rest =~ m/\G(.{$min,$max}[\x20.])?/gsx;
is either
a) an abuse of \G (owls, p15 sez "Beginning of current search" (emphasis supplied) whereas I (mis)read other docs to imply that it reset the start of the search
or...
b) use of the "?" quantifier is wrong.
And even if neither of those proves out, many thanks, both for the wisdom imparted and the implicit encouragement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: unexpected behavior with split
by ikegami (Patriarch) on Aug 31, 2004 at 20:57 UTC | |
by ww (Archbishop) on Aug 31, 2004 at 21:49 UTC |