It always returns 1 for me, unless you intend for your function to be called in list context. And since local $_ is buggy, you'd be best off avoid it.
sub next_power_of_two { my %s; @s{1..shift} = (); return %s =~ m{/(.*)} && $1; }
Update: Added local $_ fix.
In reply to Re: next power of two
by ikegami
in thread next power of two
by dk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |