I am running perl version 5.8.0 on a Sun Solaris 9.0 machine.

Given the following bit of code:

      $SOME_FILE = $_;
      chomp($SOME_FILE);
      $SOME_SAFE_FILE = $SOME_FILE . "_lax";
      system ("cp '$SOME_FILE' '$SOME_SAFE_FILE'");
      open (IN_FILE, "$SOME_FILE" );
      open (TMP_OUT_FILE, ">$tmp_file" );
      while (<IN_FILE>) {
       if ( /\<\!--########/ ) {
        s/(\<\!--########)(.*)/\<\!-- ######## $2/;
        print TMP_OUT_FILE $_;
       }
       else {
        print TMP_OUT_FILE $_;
       }
      }

When I check the contents of $SOME_FILE, I can see that the file has been
edited correctly.  However, the contents of $SOME_SAFE_FILE have been edited
also.  Given this code, shouldn't $SOME_FILE be different from
$SOME_SAFE_FILE?

Lawrence Adamiec
Unix Manager
Rm. 525B 
565 W. Adams St.
Chicago-Kent College of Law
Illinois Institute of Technology
Chicago, Illinois
312-906-5301

Reply via email to