Re: Adding text in file written in Perl

2007-08-07 Thread Srinivas
Jeff Pang wrote: -Original Message- From: [EMAIL PROTECTED] Sent: Aug 7, 2007 10:06 PM To: beginners@perl.org Subject: Adding text in file written in Perl Hello, I have written a Perl script that creates the dhcpd.conf and / etc/hosts file for Red Hat Linux. The data is derived from

Re: Adding text in file written in Perl

2007-08-07 Thread Jeff Pang
-Original Message- >From: Jeff Pang <[EMAIL PROTECTED]> > >1. write that line to hosts file at first, >open HD,">","/etc/hosts" or die $!; >print HD "127.0.0.0 localhost.localhostdomain localhost\n"; >close HD; > >2. wirte the other lines to hosts file then, >open HD,">>","/etc/hosts" or

Re: Adding text in file written in Perl

2007-08-07 Thread Jeff Pang
-Original Message- >From: [EMAIL PROTECTED] >Sent: Aug 7, 2007 10:06 PM >To: beginners@perl.org >Subject: Adding text in file written in Perl > >Hello, I have written a Perl script that creates the dhcpd.conf and / >etc/hosts file for Red Hat Linux. The data is derived from a single >tex

Re: Adding text in file written in Perl

2007-08-07 Thread Paul Lalli
On Aug 7, 10:06 am, [EMAIL PROTECTED] (Starr Corbin) wrote: > Hello, I have written a Perl script that creates the dhcpd.conf and / > etc/hosts file for Red Hat Linux. The data is derived from a single > text file. What is stumping me is how to insert an automatic text > line for just the /etc/ho

Re: Adding text in file written in Perl

2007-08-07 Thread Mr. Shawn H. Corey
[EMAIL PROTECTED] wrote: How can I get my 127.0.0.0 to appear at the top of my /etc/hosts/ file every time I run the script to create it? Rewrite the entire file. Most file systems are not set up to allow you prepend to a file. -- Just my 0.0002 million dollars worth, Shawn "For the th