develooper Front page | perl.beginners | Postings from February 2002

In-line editing..

Thread Next
Steven M. Klass
February 6, 2002 20:28
In-line editing..
Message ID:
Hi all,

	Here is the general problem.  I have a file that I need to edit but can't.  
That file is then fed into another program.  Think of the file that I want to 
edit is like a makefile, that I want to use after I tweak it a bit.  The 
general idea would be:
1) Find out what needs to be edited in FILE - DONE
2) Open file and read in the contents.  While those are being read in compare 
the stuff to be edited looking for the flags.  I'm thinking some standard 
search and replaces? - DONE (I THINK:))
3)  Now after my edits have been inputed, how do I automatically invoke my 
app using this new "buffer"  - HELP!!

Here is what I think I need :

my $APP ="/bin/someapp"
open (FILE, "file.txt") || die "Can't access file\n"; 
while (<CELL>) {
	#replace the default with my option

$APP CELL &; #<<-- This is just a guess??  Basically disconnect and run?    

Is this the right idea?  Is there a better way to do this??  Can someone 
complete this picture for me, I would really appreciate it


 Steven M. Klass
 Physical Design Manager

 National Semiconductor Corp
 7400 W. Detroit Street
 Suite 170
 Chandler AZ 85226


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About