in reply to run another perl script in perl

system "perl", "-w", "crrep.pl", $file;

update fixed wrong syntax...thanks ikegami
system "perl -w crrep.pl",$file;

Off topic from your original question but I hope a point that will be instructive: I believe that your updating algorithm is flawed. So what happens if your program were to crash before all @lines were finished?

You can't fix the error and re-run the program because at this point the original data is gone! It is better to open new file handle to $out or OUT, and send output there. When all processing is complete, delete the input file, rename the OUT file to the original file's name. Try to set up scenarios where you can just "rerun the program again" if it didn't work and minimize windows where recovery is difficult or impossible. Note that there are many ways that a program can crash that aren't your program errors (like windows restart, power fail, etc).

Replies are listed 'Best First'.
Re^2: run another perl script in perl
by ikegami (Patriarch) on Sep 03, 2010 at 15:44 UTC

    That instructs Perl to execute the file "perl -w crrep.pl". You want

    system "perl", "-w", "crrep.pl", $file; -or- system qq{perl -w crrep.pl "$file"};