Insert lines to the beginning of a file - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > Perl » Insert lines to the beginning of a file


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 07-27-2006   #1 (permalink)
logan
Junior Member
 
Join Date: Jun 2006
Age: 28
Posts: 17
Default Insert lines to the beginning of a file

Hello!

In my program I'm creating different log files of the related parts of the program and at the end I merge them into one, and delete the parts (can be regarded as temporary files)
I'd like to put a header to the merged logfile. Is there any way to insert the header after merging? Till now I created a file in the beginning of my program like this, and then I concatenated the logging
infos to this file..

open($LOG_FILE_HANDLE, ">change.log") or die "main() : change.log";
print $LOG_FILE_HANDLE "-------------------------------------------------------\n";
print $LOG_FILE_HANDLE "---------------my Log file-----------------------------\n";
close($LOG_FILE_HANDLE);

but I'd like to avoid this, and want to insert a header at the end... I couln't do this with
system `cat ... `; I use perl 5.8.0 and have no possibility to install new modules.
thanks

logan
logan is offline   Reply With Quote


Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL INSERT INTO and Numbers ashley ASP 3 07-14-2006 08:09 PM
Insert and update the same time alejandro ASP 1 07-06-2006 12:13 PM
Scans lines? act Graphics & Multimedia 3 04-20-2006 06:05 PM
Guide To Beginning Brushing/coloring Anamaru Graphics & Multimedia 0 09-27-2005 09:04 PM
Analization Lines The Rebel Graphics & Multimedia 1 08-08-2005 06:02 AM


footer left
All times are GMT. The time now is 05:55 AM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Mortgages | Free Credit Reports | Mortgage Calculator | Problem Mortgage | Credit Counseling

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49