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

Re: [Fun With Perl] Another oddity from the days of assembler



On 990614, Roland Giersig wrote:
>  sub s {
>    my $b = unpack("B*", pack("L*", shift));
>    $b =~ s/0+//g;
>    return length($b);
>  }

sub s {
  return eval join '+', split '',unpack("B*",pack("L*",shift));
}

Probably less efficient, but it takes advantage of perl's dynamic expression
evaluation capability.


==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org