Try this:

$FILE = $ENV{CLEARCASE_PN}; # Clearcase environment variable
open(FIX, "$FILE");
 undef $/;  
 # This is the input record separator.  You undef it
 # so you can pull the entire file in as a single 
 # string.
 $old_string = <FIX>; 
 (my $new_string = $old_string) =~ s/#ifdef SCCS_USED.*?#endif//gsm;
close (FIX);

$/ = "\n";
# Set this ($/) back to its original value.

$NEWFILE = $FILE."new";
open (FIX, ">$NEWFILE");
  # Every time you run this script, it will destroy any 
  # previous $FILE.new you have made because of the >
  # in the open statement.  But this is usually a good
  # thing in this type of conversion.
  print FIX $new_string;
close (FIX);
> while ($FILE) {
>       
>       (my $new_string = $old_string) =~ s/#ifdef SCCS_USED.*?#endif//gsm;
>       }
> close ( $FILE );
> 
> still kind of confused how I would go about removing that entry? 
> 
> -Wes
> 
> P.S. Thanks for your input...it is most appreciated.
> > -----Original Message-----
> > From: Shawn [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, March 21, 2001 1:45 PM
> > To: North, Wesley J; [EMAIL PROTECTED]
> > Subject: RE: Removing Text
> > 
> > 
> > (my $new_string = $old_string) =~ s/#ifdef SCCS_USED.*?#endif//gsm;
> > 
> > Have you tried something like this?
> > 
> > Shawn
> > 
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]On Behalf 
> > Of North,
> > > Wesley J
> > > Sent: Wednesday, March 21, 2001 3:34 PM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: Removing Text
> > > Importance: High
> > >
> > >
> > > Group,
> > >
> > >   I've been tasked with removing text from files that 
> > have been under
> > > SCCS source control. Basically I need to find the following entry
> > > and remove
> > > it:
> > >
> > > #ifdef SCCS_USED
> > > static char SccsId[] = ......(etc)
> > > #endif
> > >
> > > this is basically SCCS keyword expansion...or ident. So I 
> > obtained a borne
> > > shell script and have been trying to get it to work...but 
> > it doesn't. What
> > > is the fastest most effective way of removing these lines 
> > of code? I guess
> > > through sed I can find all entries contained inside the #'s 
> > right? But for
> > > some reason I get lost and the script fails when I try to 
> > remove all those
> > > lines. Any and all help/suggestions are most welcome. Thanks.
> > >
> > >
> > > -Wes
> > >
> > > _______________________________________________
> > > ActivePerl mailing list
> > > [EMAIL PROTECTED]
> > > http://listserv.ActiveState.com/mailman/listinfo/activeperl
> > >
> > >
> > 
> 
> 
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to