dReKurCe has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks: My question is in regards to the following code:
Specifically, what methodology is used to read each succesive set into it's own array?for $x(1...3){ for$y(1...3){ $pro=$x ** $y; push @products, $pro; } }
I managed to sort this out without the use of modules by using splice. Thanks for the help
#! /usr/bin/perl for $x(1...8){ for (1...8){ $y=$x*$_; push @products,$y; } print "\n"; @pro=splice (@products,0,8); print "@pro\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Seperating Compound Lists
by edoc (Chaplain) on Feb 11, 2005 at 02:12 UTC | |
by Roy Johnson (Monsignor) on Feb 11, 2005 at 02:40 UTC | |
|
Re: Separating Compound Lists
by Roy Johnson (Monsignor) on Feb 11, 2005 at 02:07 UTC |