in reply to How to remove a variable from a folder having lots of pm file in it using a command

find lib -type f -name '*.pm' -exec \ perl -i~ -pe's/addFieldsToSolrDocuments\([^,]*,[^,]*\K,[^,]*//' {} +

This creates a backup of each file foo.pm -> foo.pm~. Be sure to review the differences if any. It's not very precise.

(You can combine the two lines by removing the "\".)

  • Comment on Re: How to remove a variable from a folder having lots of pm file in it using a command
  • Download Code

Replies are listed 'Best First'.
Re^2: How to remove a variable from a folder having lots of pm file in it using a command
by Priti24 (Novice) on Jan 13, 2012 at 08:47 UTC

    Thank u very much