in reply to Allocated memory to Script
To stop, do$mu->record($your message here);
To insert the results at the end, there are a couple of ways that I like. I prefer "state()" which returns an arrayref.$mu->record->($msg here);
#! perl -sl use strict; use warnings; use Memory::Usage; use Data::Dump qw(dump); my $mu = Memory::Usage->new(); $mu->record('start =>'); open FH, '<', $ARGV[0] or die "file not found"; my $line = 0; my %hash ; while( <FH> ) { $hash{ $line } = undef; $line++; } close FH; $mu->record('end =>'); print dump($mu->state());
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Allocated memory to Script
by BrowserUk (Patriarch) on Jul 08, 2011 at 12:42 UTC | |
by Khen1950fx (Canon) on Jul 08, 2011 at 13:30 UTC | |
by BrowserUk (Patriarch) on Jul 08, 2011 at 13:38 UTC | |
by Anonymous Monk on Jul 08, 2011 at 13:41 UTC | |
by BrowserUk (Patriarch) on Jul 08, 2011 at 13:47 UTC | |
by Anonymous Monk on Jul 08, 2011 at 13:35 UTC |