i vote for the database as well. even if you have to install mysql yourself. but if you must you can try something like this.
#!/usr/bin/perl # # foo - called by bar. recieves files to search on it's # input, calculates top N, retrieves the details for # the top N and prints them to STDOUT in some easily # parseable format # use strict; use warnings; $|++; my @files = <>; chomp @files; for (@files) { # process files warn "processing $_$/"; } my @top = ( [ a => 10 ], # get top N [ b => 5 ], [ c => 3 ], ); my %detail = ( # and detail info a => [ 1, 1, 4, 2, 1, 1 ], b => [ 1, 2, 2 ], c => [ 1, 2 ], ); for (@top) { printf "%s %d$/", @$_; printf "@{$detail{$_->[0]}}$/"; } exit; #!/usr/bin/perl # # bar - calls foo as a child process and colects tidbits # of data for future use. foo's memory will go back # to the system soon after the answers are read. # use strict; use warnings; use IPC::Open2; my @files = qw( xxx xxy xxz ); my ($read, $write, $child); $child = open2($read, $write, './foo'); print $write $_,$/ for @files; close $write; my @info = <$read>; close $read; waitpid $child, 0; print @info;
In reply to Re: Re: Re: Force perl to release memory back to the operating system
by zengargoyle
in thread Force perl to release memory back to the operating system
by Roger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |