hello, i'm having trouble printing arrays to file.
each time i run this code, i get only two results max.
if the array has 2 genres, i get them but no languages.
if the array has 1 genre i get it and only 1 language.
if the array has more than 2 genres, i get only 2 and no languages.
help will be greatly appreciated.
sub WriteLineToFile{
my $MTitle = shift;
my $MYear = shift;
my $MDirectors = shift;
my $MRatings = shift;
my $MVoters = shift;
my $MLength = shift;
my $MAward = shift;
my @MGenres = shift;
my @MLanguages = shift;
my $commas = 0;
my $arrLen = 0;
my $Genre;
open(FH,">>","movieOutput.csv") or die "cannot... nohave\n";#append rows to file
print FH $MTitle,",", $MYear,",",$MDirectors,",",$MRatings,",",$MVoters,",",$MLength,
",",$MAward,",";
for $element (@MGenres){
print FH $element.",";
}
for $element (@MLanguages){
print FH $element.",";
}
print FH "\n";
close FH;
}#end sub