in reply to Cache commands output

It sounds like you want to store the results between runs of your perl script. In that case, what you suggest sounds reasonable. I would encapsulate this in either a function or a module, something like
sub invokeCmd { my ($cmd) = @_; # assuming full path for cmd, change path from # cmd area to results area my $curResultsFile=$cmd."res"; # stat the file, check for existence, and 'last mod' value if ($too_old) { # re-run command and store results in $curResultsFile } my $res; open $res, $curResultsFile or die "could not open results: $!\n"; return $res; }
Update What Kyle suggests would work just fine as well. Depending on how long your commands take to run, and how long you wish to store the results, You should probably avoid storing the results under /tmp (the default for Cache::FileCache), as a reboot deletes everything there.