my $amount = shift; # disperse amount die "must be integer" if $amount != int($amount); die "too big" if $amount > 1000; die "too small" if $amount < 1; for (my $en = 1; $amount; $en <<= 1) { next unless $amount & $en; print "Giving you envelope with $en\n"; $amount &= ~ $en; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: 1,000 bucks
by merlyn
in thread 1,000 bucks
by idnopheq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |