Hi Monkees,
What's the best way to read a particular line from a file? e.g. I want to perform a regex against line 10 of a file, but I don't want/need to read in the whole file.
works, but I'm not sure how efficient this is. I could run a loop, but that would look messy, and if I want, say, line 5000, it would be inefficient (IMHO).my $line2 = (<FILE>)[9];
Any advice?
In reply to Best way to read line x from a file by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |