in reply to Re: How to collect the stdout of a subroutine call?
in thread How to collect the stdout of a subroutine call?
my $xx = &log; print "<b>$xx</x>";
sub log { my $log_file = "log.txt"; open(LOGFILE, "$log") or die("Could not open log file."); #my %seen; my %seen = (); my %typeseen = (); # read it in my $test = "Home Company"; while(<LOGFILE>) { next unless /($test)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\*(.*?)\*(. +*?)$/; my ($item, $logintype) = ($1, $4); #print $item; $seen{$item}++; $typeseen{$item}{$logintype}++; } # dump it out foreach my $item (sort keys %seen) { print "$item:<br>\n"; print "\tLog in activity: ", $seen{$item}, "<br>\n"; foreach my $type (sort keys %{$typeseen{$item}}) { print "\t", $type, " activity: ", $typeseen{$item}{$type}, "<br>\n +"; } } } ####### END SUB LOG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: How to collect the stdout of a subroutine call?
by Roy Johnson (Monsignor) on Apr 19, 2004 at 19:15 UTC | |
|
Re: Re: Re: How to collect the stdout of a subroutine call?
by jdporter (Paladin) on Apr 19, 2004 at 19:15 UTC | |
|
Re: Re: Re: How to collect the stdout of a subroutine call?
by disciple (Pilgrim) on Apr 19, 2004 at 18:48 UTC | |
by Anonymous Monk on Apr 19, 2004 at 19:25 UTC | |
by disciple (Pilgrim) on Apr 19, 2004 at 19:35 UTC | |
by Anonymous Monk on Apr 19, 2004 at 19:36 UTC | |
by disciple (Pilgrim) on Apr 19, 2004 at 19:41 UTC | |
|
Re: Re: Re: How to collect the stdout of a subroutine call?
by ambrus (Abbot) on Apr 19, 2004 at 20:21 UTC |