Griggs Rob wrote:
> 
> Im trying to write a line of text to a file but when i do this the text is
> written but onto the front of the next line. I want it to write the text
> into the file on its own line after the found line!
> 
> The below code is replacing the regular expression with the line of text
> (which is not what i want) so that my file line then becomes:
> 
> This is a test5.0.1/255.255.255.255 -d 0.0.0.0/0.0.0.0 22:22 -p 6 -j ACCEPT
> 
> Instead of:
> 
> -A input -s 10.5.0.1/255.255.255.255 -d 0.0.0.0/0.0.0.0 22:22 -p 6 -j ACCEPT
> This is a test


perldoc -q insert

Found in /usr/lib/perl5/5.6.0/pod/perlfaq5.pod
       How do I change one line in a file/delete a line in a
       file/insert a line in the middle of a file/append to the
       beginning of a file?



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to