There is a lot of files that's going to be opened a lot of times, so I just want to be sure that this link in the chain is optimalSo, you want to make sure the most optimal way of closing your car door, because you are going to make a lot of road trips? Even if it's just trips to the shop, it's not significant.
The thing I'm most concerned with is the best way to put the file in the variable.Ah, but where's the printing aspect?
Anyway, it's faster to read it in one go instead of first putting it in an array, then joining them one line at the time:
Or you can use sysread, but you'll have to benchmark if that's faster.my $text = do {local $/; <FILE>};
You also may be able to tweak your filesystem/volumemanager/storagemanager to get a better performance. After all, your road trip gets shorter if you make use of tarmac roads instead of dirt roads. Regardless of the car you use, or your driving skills.
In reply to Re^5: Most efficient way to print a file?
by JavaFan
in thread Most efficient way to print a file?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |