Re: Anyone using Ruby for scripting?

  • From: "Radoulov, Dimitre" <cichomitiko@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 20 Sep 2010 20:16:09 +0200


On Mon, Sep 20, 2010 at 6:29 AM, Blanchard, William G <William.Blanchard@xxxxxxxxxxxxx <mailto:William.Blanchard@xxxxxxxxxxxxx>> wrote:

     I can write a perl one-liner that edits a file but can’t, from
    within a perl script, directly edit a file.



You can:

{
  local ($^I, @ARGV) = ('', 'your_file');
  while (<>)
    {
      s/current/new/;
      print;
      }
  }


Regards
Dimitre

Other related posts: