Your posted code produces errors and warnings. I think you are not clear about declaring array in Perl, see perldata
Here is the corrected code
#!/usr/bin/perl -w
use strict;
sub job {
my @row= ('AAA','BBB'); # or my @row = qw(AAA BBB);
return @row;
}
my @red =job();
foreach my $r(@red)
{
print $r;
}