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; }
In reply to Re: Re: Re: How to collect the stdout of a subroutine call?
by disciple
in thread How to collect the stdout of a subroutine call?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |