I am hacking at an old perl scrip that is used to generate and maintain a private CA. The script contains this code:

. . . use IPC::Run qw( start pump finish timeout new_appender new_chunker); . . . sub cmd { my $self = shift; my $cmd = shift; my $cmdline = shift; my $args = shift; my $conf; my $cfgcmd; if ( (grep $_ eq $cmd,qw(req ca)) && !$args->{noconfig}) { $conf = $self->{csp}->writeConfig($cmd,$args); $self->{csp}->die("Unable to write configuration file") unless -f $c +onf; $cfgcmd = " -config $conf "; } elsif ($cmd eq 'x509' && !$args->{noconfig}) { $conf = $self->{csp}->writeConfig($cmd,$args); $self->{csp}->die("Unable to write configuration file") unless -f $c +onf; $cfgcmd = " -extfile $conf -extensions extensions "; } $cmd = '' if $cmd eq 'dummy'; ${$self->{_in}} = "$cmd $cfgcmd $cmdline"; if ($ENV{CSPDEBUG}) { $self->warn("Here I am"); $self->warn("# openssl $cmd $cfgcmd $cmdline\n"); } $self->{_handle}->pump while length ${$self->{_in}}; $self->{_handle}->finish; . . .
When I run this command
csp CA_HLL_ROOT_2016 init --verbose --type=root --keysize=4096 --days= +7317 --url=ca.harte-lyne.ca --email=certificates@harte-lyne.ca --dige +st=sha512 "CN=CA_HLL_ROOT_2016,OU=Networked Data Services,O=Harte & L +yne Limited,L=Hamilton,ST=Ontario,C=CA,DC=harte-lyne,DC=ca"
then I get this result:
[CSP][ ] Here I am [CSP][ ] # openssl genrsa -des3 -passout pass:'test me' -out / +home/byrnejb/Projects/Software/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/pr +ivate/ca.key 4096 [CSP][ ] Here I am [CSP][ ] # openssl req -config /home/byrnejb/Projects/Software +/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/tmp/csp-32489.conf -x509 -sha51 +2 -days 7317 -key /home/byrnejb/Projects/Software/rcsp/ca_test_a/csp +/CA_HLL_ROOT_2016/private/ca.key -passin pass:'test me' -new -out /ho +me/byrnejb/Projects/Software/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/ca.c +rt

There are no errors but the files specified in the command lines are not created. If I copy and paste the command lines that are output from the warn statements then the files are created without problem.

I have zero experience with Perl. Well, not quite zero any more but not much. Is there something obvious that I am missing here? The entire project is available on github at https://github.com/byrnejb/rcsp/tree/csp040 if more context is desired.


In reply to IPC::Run command is correctly constructed but does not have effect by byrnejb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.