Im a newbie in perl. So the question might sound something naive.
I have two following functions
#This function will return the reference of the array
sub getFruits1
{
my @fruits = ('apple', 'orange', 'grape');
return \@fruits;
}
But in the following case?
#How it returns?
sub getFruits2
{
my @fruits = ('apple', 'orange', 'grape');
return @fruits;
}
Will getFruits2
return a reference and a new copy of that array will be created?