in reply to Re: Seek one liner for distributing an integer
in thread Seek one liner for distributing an integer
or if you want something ugly:
%result = map{pop@array,length}('1'x$num)=~/^@{['(.*)'.'(\1.?)'x$#array]}$/;
Apparently, map + regexps can do anything! ☺
Non-destructive:
%result = map{$array[$i++],length}('1'x$num)=~/^@{['(.*)'.'(\1.?)'x$#array]}$/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Seek one liner for distributing an integer
by sleepingsquirrel (Chaplain) on Sep 22, 2004 at 16:16 UTC | |
by ikegami (Patriarch) on Sep 22, 2004 at 16:19 UTC |