IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 11, 2006, 3:15:34 PM (20 years ago)
Author:
jhoblitt
Message:

use storable to store the complete output of run()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cache/ippScripts/scripts/phase0_imfile.pl

    r9476 r9493  
    77$VERSION = '0.01';
    88
     9use Cache::File;
     10use Storable qw(freeze thaw);
     11use File::Basename qw( basename);
    912use IPC::Cmd qw( can_run run );
    1013use PS::IPP::Metadata::Config;
    1114use PS::IPP::Metadata::Stats;
    12 use Data::Dumper;
    13 use Cache::File;
    1415
    1516use PS::IPP::Config;
     
    7980
    8081my $c = Cache::File->new(
    81     cache_root => File::Spec->catdir($ENV{'HOME'}, '.pxcache'),
     82    cache_root => File::Spec->catdir($ENV{'HOME'}, '.', basename($0)),
    8283    default_expires => '7200 sec',
    8384);
     
    9697    if (defined $cmd_output) {
    9798        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
    98             = @{$cmd_output};
     99            = @{thaw $cmd_output};
    99100    } else {
    100101        my @output = run(command => $command, verbose => 1);
    101         $c->set($command, \@output) if $cache;
     102        $c->set($command, freeze \@output) if $cache;
    102103        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
    103104            = @output;
Note: See TracChangeset for help on using the changeset viewer.