Try setting $len to 5. You'll see that the 'tight' version fails to wrap correctly under certain circumstances like this
Wrapping: @[0;7mCoruscate@[0m says this is a test of the line wrapping code Tight code1: @[0;7mCoruscate@[0m says this is a test of the line wrapping code Tight code: @[0;7mCorus cate@[0m says this is a test of the line wrapp ing code
which suggested to me that the regexes be executed in opposite order
Wrapping: @[0;7mCoruscate@[0m says this is a test of the line wrapping code Tight code1: @[0;7mCorus cate@[0m says this is a test of the line wrapp ing code Tight code: @[0;7mCorus cate@[0m says this is a test of the line wrapp ing code
which seems to do the trick. I believe the first regex gets stymied by lines that have to be split many times at a space, as well as being split many times inside a word.
In reply to Re: Re^2: No \G for s///g ? (oops)
by demerphq
in thread No \G for s///g ?
by tye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |