[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Formatting integer sets with ranges



On Fri, Jan 07, 2000 at 02:11:52PM -0800, Yitzchak Scott-Thoennes wrote:
> 
> my ($prev, $beg);
> print map(!$prev ? ($beg = $prev = $_) :
>           $_ == $prev+1 ? do {++$prev; ()} :
>           do { my $xprev = $prev;
>           (($beg != $xprev ? ('-', $xprev) : ()), ',',$beg = $prev = $_)},
>           @issues),
>       $beg != $prev ? ('-', $prev) : ();
> print "\n";
> 
> The do { my $xprev stuff I needed to work around what seems like a perl bug.
> 

Hey, we're not going to let you get away with that!  What is this "seeming
Perl bug"?

Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe