Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, i need to run a program several times over with different inouts, but sure how to go about this in a correct perl way. 1) chdir 2) run program with set of inputs and output file 3) when finish change to next dir and rerun? Thanks,

Replies are listed 'Best First'.
Re: running programs
by Anonymous Monk on Jul 10, 2004 at 18:16 UTC
    i would use
    while (<>) { chomp $_; #defined by a list if directories piped in chdir $_; system " run prog"; chidr .. }
    but the inputs do vary!?
Re: running programs
by coreolyn (Parson) on Jul 12, 2004 at 12:10 UTC

    I've been leaning on this for program execution in a heavy production enviornment ( Solaris and NT ) for about two years now.. I've had half a dozen incidents ( NT only ) of the launched process getting 'lost' and not returning ( Never in production only Unit and Test ). It gives me good flexibility for both input and output.