App-pandoc-preprocess

 view release on metacpan or  search on metacpan

bin/ppp  view on Meta::CPAN

use File::Spec;
use File::Temp 'tempdir';
use File::Path 'make_path';

# configuration set as --key value at command line or as key=value from file
our %config;
our ($img, $log);

# load configuration from file in current directory if given
{
    if (local @ARGV = grep { -e $_ } qw(.ppprc ppp.conf)) {
        while (<>) { # parse simple "key = value" pairs
            $config{$1} = $2 if /^\s*(\w+)\s*=\s*(.*?)\s*$/;
        }
    }
}

# parse command line options
while (@ARGV) {
    last unless $ARGV[0] =~ /^--(\w*)$/; # --key
    last unless length($1);              # "--" stops option parsing

t/10-dirs.t  view on Meta::CPAN

tie $stdout, 'IPC::Shareable', 'stdout', { create => 'true' } or die "tie failed\n";;
tie $stderr, 'IPC::Shareable', 'stderr', { create => 'true' } or die "tie failed\n";;

# emulate calling ppp on command line
sub ppp(@) {
    $stdout = undef;
    $stderr = undef;

    my $pid = fork();
    if ($pid == 0) {
        local @ARGV = @_;
        my ($stdout, $stderr);
        tie $stdout, 'IPC::Shareable', 'stdout';
        tie $stderr, 'IPC::Shareable', 'stderr';
        ($stdout, $stderr) = Capture::Tiny::capture(sub { do 'bin/ppp'; });
        exit;
    }
    waitpid($pid, 0);
}

# explicitly state dirs via command line

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.921 second using v1.00-cache-2.02-grep-82fe00e-cpan-c9a218a2bbc )