Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- I need to ADD to the BEGINNING of a data file


rocknbil - 4:15 pm on Feb 14, 2012 (gmt 0)


If the file is not huge, another way is to open the file, store all lines in a scalar $tmp

$tmp = param('name') . "\n" . $tmp;

overwrite file.

I generally store the original $tmp in a backup first to be (a little bit) safer about it.


Thread source:: http://www.webmasterworld.com/perl/4417237.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com