Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Why not something like $mm->runcmd(%opt) where %opt:
    cmd => argv[0]
    args => [argv[1..]]
    env => {...}
    cwd => directory where to cd in and out of
    stdin => file
    stdout => file
    Shades of t/, don't you think? :-)

    • See MM_Any->oneliner(). It makes the job barely tolerable. Here's an example from generating the clean target.

              # Equivalent to 'cd $dir && $(TESTF) $(FIRST_MAKEFILE) && $(MAKE) clean'
              for my $dir (@{$self->{DIR}}) {
                      my $subclean = $self->oneliner(sprintf 'CODE', $dir);
      chdir '%s'; system '$(MAKE) clean' if -f '$(FIRST_MAKEFILE)';