in reply to Printing from three arrays
use strict; use warnings;
The purpose is to help you solve you own problems. In this case, you will get several error messages. Some of them will not make any sense to you. Fix the easy ones and try again. You probably have fixed more than you thought. You may have also revealed a few more errors. Keep fixing errors a few at a time until it runs. If you really get stuck, ask for explanation of your remaining errors. Your current script probably will not run correctly even when it does run. You may have to ask for help again. It is much easier for the monks to find a fix you logic errors when they are not masked by other errors.
Another hint is to use meaningful variable names. Note the improvement in this solution.
use strict; use warnings; my @digits = qw(1 2 3); my @letters = qw(a b c d e f g); my @romans = qw(I II III); foreach my $letter (@letters) { foreach my $roman (@romans) { foreach my $digit (@digits) { print "$digit,$letter,$roman\n"; } } }
|
|---|