in reply to Unobvious Pathological Code Snippets
This, (attributable to Juerd) is kinda cute, and a little surprising:
my @a = '01' .. '30'; print "@$_" for sub{ my $n=shift; map{ [ splice @_, 0, $n ] } 0 .. @_ / $n }->( 5, @a ); 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 print @a; 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 +4 25 26 27 28 29 30
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unobvious Pathological Code Snippets
by QM (Parson) on Mar 28, 2006 at 18:52 UTC | |
by BrowserUk (Patriarch) on Mar 28, 2006 at 19:44 UTC | |
by QM (Parson) on Mar 28, 2006 at 20:17 UTC | |
by BrowserUk (Patriarch) on Mar 28, 2006 at 21:30 UTC | |
by xdg (Monsignor) on Mar 28, 2006 at 23:16 UTC |