Hi,
I am a newbie to a perl.
I have a problem in getting old and new contents of file.
The file is like this:
StartTimeStamp,EndTimeStamp,counter1,counter2
Aug15 2010 22:45:43,Aug15 2010 23:00:00,6,0
Aug15 2010 23:00:00,Aug15 2010 23:07:43,3,0
The output should be:
Aug15 2010 23:00:00,Aug15 2010 23:07:43,3,0
After some process are run the file gets updated.
StartTimeStamp,EndTimeStamp,counter1,counter2
Aug15 2010 22:45:43,Aug15 2010 23:00:00,6,0
Aug15 2010 23:00:00,Aug15 2010 23:07:43,3,0
Aug15 2010 24:00:00,Aug15 2010 24:07:43,8,0
Aug15 2010 25:00:00,Aug15 2010 25:07:43,2,0
The output should be:
Aug15 2010 24:00:00,Aug15 2010 24:07:43,8,0
Aug15 2010 25:00:00,Aug15 2010 25:07:43,2,0
My question is get how to get the old and new contents of this file.
I tried using pop function but did not get it.
Any suggestions how to get the old and new values from a file in Perl?
Regards
Amith