Hai ! Open the file with any file handler and use regular expression.. This way it will work.
Open (File handler name ,">>file name"); While ( $string=<filehandler>) { if ( $string = ~ /^Alpha\(a,b,c\)/ ) { $string = "#" . $string ; print <file handler> $string ; } } Arjun -----Original Message----- From: Urs Wagner [mailto:[EMAIL PROTECTED] Sent: Monday, October 11, 2004 4:24 PM To: [EMAIL PROTECTED] Subject: Line replace Hello I should comment out lines in a text file. I have a lot of troubles to realize this. The lines Alpha(a, b, c) should be changed to # Alpha(a, b, c) What I would like to write is a small perl script to make this convetion. Thanks Urs -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>