>>>>> "Paul" == Paul <[EMAIL PROTECTED]> writes:
Paul> Couldn't
>> if ($val < 1) {
>> push @stretch, $char;
>> }
>> if ($val >= 1 or eof()) {
Paul> be done to the same result with just
>> if ($val < 1) {
>> push @stretch, $char;
>> } elsif (eof()) {
No, because I need to use the results of the conditional push in the
next clause.
It's a messy set of conditions, that overlap and interact in odd ways.
If I had an artificial pass through the loop, where I'd introduce a
"stretch ender" at EOF, it'd be simpler. The problem is that you
don't know you're looking at the last item of a stretch until the next
item is up, or this item is EOF. So, you get an off-by-one offset in
the ending trigger. Bleh.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!