in reply to Re: Re: How to collect the stdout of a subroutine call?
in thread How to collect the stdout of a subroutine call?
You must use the return statement inside your subroutine. I am not sure I understand exactly what you are trying to do from reading your code, but I am assuming you want everything you are printing to be returned (Update and not printed). In that case you need to put the data in the variable first, then return it. Like this.... (code not tested)
my $output; foreach my $item (sort keys %seen) { $output .= "$item:<br>\n"; $output .= "\tLog in activity: ", $seen{$item}, "<br>\n"; foreach my $type (sort keys %{$typeseen{$item}}) { $output .= "\t", $type, " activity: ", $typeseen{$item}{$type}, "< +br>\n"; } return $output; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: How to collect the stdout of a subroutine call?
by Anonymous Monk on Apr 19, 2004 at 19:25 UTC | |
by disciple (Pilgrim) on Apr 19, 2004 at 19:35 UTC | |
|
Re: Re: Re: Re: How to collect the stdout of a subroutine call?
by Anonymous Monk on Apr 19, 2004 at 19:36 UTC | |
by disciple (Pilgrim) on Apr 19, 2004 at 19:41 UTC |