begood321 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Guys,
I can't seem to get my value to pass from subroutine to subroutine call as seen below. I get values in logger reports1 but not in logger reports2.
@reports = &getValidTotals(); $logger->write_log("reports2: @reports", "INFO");. . . . . sub getValidTotals { my ($reportGroup, $total) = @_; my @reports = qw(); if ($reportGroup ne "") { push(@reports,$reportGroup); $logger->write_log("reports1: @reports, total: $total", "INFO"); } return (@reports); }
Hi Ken,
I have use warnings in my code and didn't get warning. I have been trying to use correct syntax. What's the correct syntax.
I tried code below but didn't get array contents
@reports = &getValidTotals($reportGroup, $total);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Return array not passed to sub call
by kcott (Archbishop) on Nov 19, 2010 at 04:24 UTC | |
|
Re: Return array not passed to sub call
by kcott (Archbishop) on Nov 19, 2010 at 09:05 UTC | |
by umasuresh (Hermit) on Nov 19, 2010 at 17:44 UTC | |
by begood321 (Novice) on Nov 19, 2010 at 15:41 UTC | |
by begood321 (Novice) on Nov 20, 2010 at 00:41 UTC | |
by kcott (Archbishop) on Nov 26, 2010 at 16:01 UTC |