Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Sirs,
Please be patient with me I am new in Perl and programming.
How I can modify my code below:
Thanks so much.
Eddie.
Please be patient with me I am new in Perl and programming.
How I can modify my code below:
To simply print just:my @num = qw (1 2 3 4 5); my @alp = qw (A B C D E); # these two arrays always come in same size foreach my $num (@num){ foreach my $alp(@alp){ print "$num-$alp\n"; } }
So I want them to each element from each array printed in concordance respective to their position. If possible I want to keep it as 'foreach' structure, so it allows me to apply it to more complex array structure (array of array).1-A 2-B 3-C 4-D 5-E
Thanks so much.
Eddie.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Concordance Printing of Two Arrays
by pg (Canon) on Oct 17, 2005 at 03:18 UTC | |
Re: Concordance Printing of Two Arrays
by sk (Curate) on Oct 17, 2005 at 03:20 UTC | |
Re: Concordance Printing of Two Arrays
by japhy (Canon) on Oct 17, 2005 at 03:19 UTC | |
Re: Concordance Printing of Two Arrays
by gopalr (Priest) on Oct 17, 2005 at 08:54 UTC | |
Re: Concordance Printing of Two Arrays
by ioannis (Abbot) on Oct 17, 2005 at 05:07 UTC | |
Re: Concordance Printing of Two Arrays
by NateTut (Deacon) on Oct 17, 2005 at 18:55 UTC |
Back to
Seekers of Perl Wisdom