Proch::Cmd - Execute shell commands with caching capability to store output of executed programs (useful for multi step pipelines where some steps can take long) {beta}
version 0.005
use Proch::Cmd; # The module is designed with settings affecting every execution my $settings = Proch::Cmd->new( command => '', verbose => 1, debug => 1 ); # Settings can be edited at any time $settings->set_global('working_dir', '/hpc-home/telatina/tmp/'); # Create a new command object my $c1 = Proch::Cmd->new( command => 'ls -lh /etc/passwd /etc/vimrc hello', input_files => ['/etc/passwd' , '/etc/vimrc', 'hello'], output_files => [], debug => 0, verbose => 0, object => \$object, ); my $simple = $c1->simplerun(); say $simple->{output} if (! $simple->{exit_code});
Proch::Cmd - Execute shell commands controlling inputs and outputs
version 0.0041
The method creates a new shell command object, with the followin properties:
The shell command to execute
Command temporary directory, should be the pipeline output directory, can be omitted for minor commands like 'mkdir', but should be set for pipeline steps.
Optional description of the command, for log and verbose mode
A list of files that must exist and be not empty before command execution
A list of files that must exist and be not empty after command execution
If command returns non zero value, die (default behaviour)
Enable verbose execution
Don't skip command execution if the command was already executed
Executes the shell command returning an object.
Returns the value of a setting given its name ('Attribute')
Set the value of a setting item, given its name ('Attribute')
The 'scripts' directory contain a read_cache_files.pl that can be used to display the content of this module's cache files. The 'data' directory contain a valid example of data file called 'data.ok'. To view its content:
perl scripts/read_cache_files.pl -f data/data.ok
Andrea Telatin <andrea.telatin@quadram.ac.uk>
This software is Copyright (c) 2019 by Andrea Telatin.
This is free software, licensed under:
The MIT (X11) License
To install Proch::Cmd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proch::Cmd
CPAN shell
perl -MCPAN -e shell install Proch::Cmd
For more information on module installation, please visit the detailed CPAN module installation guide.