i have a file called edit where a list of file paths is given and in each of the file given in the path i need to match for multiple lines and delete them if they are there and save the file with the same file name . i have written a piece of code that works fine individually when $path is set to individual file but when i have file named edit contains multipe file path this script doesnt seem to do anything when it reaches the internal while loop . please let me know if i m doing some wrong

#!/usr/bin/perl #edit contains the complete path of the files to be edited my $path = "/home/rjs/heena/edit" ; #geting a file handler open(FL, "$path"); #getting all the file names in the @array so that i can process the fi +le one by one my @array = <FL>; while ( my $array = shift @array) { my $file = $array; @ARGV = ($file); # $INPUT_RECORD_SEPARATOR $/=""; # $INPLACE_EDIT $^I=".bak"; print "all fine \n "; while(<>) { # nothing seems to happen after this piece of code s/CONFIDENTIAL(.*?)own\s+risk/ /sm; print ; } }

a sample view of the file

/********************************************************************* +********/ /* + */ /* Copyright (c) 1996 - 2003 + */ /* Campaco Systems, Inc. + */ /* + */ /* All Rights Reserved + */ /* + */ /* CONFIDENTIAL and PROPRIETARY -- + */ /* No Dissemination or use without prior written permission + */ /* + */ /* Permission to use, copy, modify, distribute and sell this software +and */ /* its documentation for any purpose is hereby prohibited, unless gran +ted */ /* an explicit permission from Campaco Systems, and provided that the +above */ /* copyright notice appears in all copies and that both that copyright + */ /* notice and this permission notice appear in supporting documentatio +n. */ /* + */ /* Campaco Systems makes no representations about the suitability of t +his */ /* software for any purpose. + */ /* It is provided "as is" without express or implied warranty. Modific +ation */ /* of the code is allowed at the modifier's own risk.

In reply to in place editing a list of files by rjsaulakh

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.