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).


In reply to Re: run another perl script in perl by Marshall
in thread run another perl script in perl by satzbu

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.