c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -e
"my @modules = qw(zero one two three four five six seven);
;;
while (@modules) {
dd \@modules;
my $n = $#modules / 2;
print qq{@modules[ 0 .. $n ] -- @modules[ -$n-1 .. -1 ] \n\n};
pop @modules;
}
"
["zero", "one", "two", "three", "four", "five", "six", "seven"]
zero one two three -- four five six seven
["zero", "one", "two", "three", "four", "five", "six"]
zero one two three -- three four five six
["zero", "one", "two", "three", "four", "five"]
zero one two -- three four five
["zero", "one", "two", "three", "four"]
zero one two -- two three four
["zero", "one", "two", "three"]
zero one -- two three
["zero", "one", "two"]
zero one -- one two
["zero", "one"]
zero -- one
["zero"]
zero -- zero
Update: Added '--' marker to output to make partitioning clearer.
Give a man a fish: <%-(-(-(-<
|