Here is another way
use strict; use warnings; open (FILE,"+<","test"); local $/=undef; my $a=<FILE>; $a =~ s/^(.*)$/<pre>$1<\/pre>/gs; seek(FILE,0,0); print FILE $a;
But you have to be careful when the file size is huge
The great pleasure in my life is doing what people say you cannot do.
In reply to Re: Adding <pre> at beginning </pre> at file end
by lakshmananindia
in thread Adding <pre> at beginning </pre> at file end
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |