On Tue, Jun 15, 2004 at 07:58:23AM +0900, Warren Brown wrote:
> > while(<binkd>)
> > {
> >     # date parsing code was here
> >      @diff=Delta_DHMS(@binkdate,@today) if /(\[\d+\])/;
> >      print $trimmed $_ if $diff[0] < $ARGV[1] && defined(@diff);
> >      next  if defined(@diff);
> >      print $trimmed $_ if ! /(\[\d+\])/;
> >      undef(@diff);
> > }
> 
> while(<binkd>)
> {
>     # date parsing code was here
>      if /(\[\d+\])/ then
>          diff = Delta_DHMS(@binkdate,@today);
>          print $trimmed $_ if diff[0] < $ARGV[1];
>          next;
>      else
>          print $trimmed $_;
>      end
> }

yeah. much nicer. shorter also.

(number of actions / conditions)
perl: 2+3+2+3+1 == 11
ruby: 1+1+2+1+1 == 6

Alex