|Welcome to the Monastery|
inline file modificationby Woodchuck (Initiate)
|on Sep 07, 2005 at 16:07 UTC||Need Help??|
Woodchuck has asked for the
wisdom of the Perl Monks concerning the following question:
simple file read and write question. I've looked it up on the database but could not find what I wanted (or is it that I don't know how or what to look for)... ok... cutting to the chase...
I'm reading a file and when I find a certain line which contains some 'idTag' character I wish to overwrite it. The fact is the lines don't always have the same length. Somtimes... they're longer... sometimes shorter...
Is it possible to do this in a clean way with the read and write operator "+<" without having to introduce a temporary file?
Speaking of which... I can't really seem to find a use for the tmp_file constructor in the IO::File module. If you have an example please let me know.
Thanks in advance!
p.s. I hate it because the more I code, the messier it gets...