Well, certainly each call to $text->insert takes time. You can do it with just one call, like this: {
local $/;
$text->insert('end', <FILE> );
}
That will insert the entire file at once.
However, if the file is really large, you will always have problems trying to hold the entire file in memory at once. Good text editors are smart enough to page out the parts of the file not being viewed, in an efficient manner. You may have to resort to this kind of trick.
|