Hi All, I have a doubt in my code. I'm using subroutine, where once i call it, i'm storing those values another array variable & read each using Foreach loop. But i'm getting only the first value of the array, by using forreach loop. Could some please correct by code.
#!/usr/bin/perl -w use strict; sub job { @row= {AAA,BBB}; return @row; } my @red =job(); foreach my $r(@red) { print $r; }
Could someone please correct where i'm conceptually wrong. Its just returning 'AAA' as output, instead of returning both.
In reply to Subroutine - Return Array by Sachin_dada
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |