in reply to Re^2: How to read from a file instead from a hard coding list.
in thread How to read from a file instead from a hard coding list.
Windows has no cat command out of the box.Does Windows has perl out of the box?
Why spawn a new process to read a file when perl can read the file without assistance?Who cares about a new process? It isn't that we're doing this a billion times in a loop, and considering we're going to read a couple of Mb from disk, I don't think creating a new process is going to form a bottleneck.
File::Slurp does a nice job.And that one comes with Windows out of a box? Really, you need a module to read in a file? What's wrong with
or some other equivalent lines if you're willing to spend more keystrokes than `cat` is taking? Why is that using a module to do this is ok, but using a program isn't?chomp(my @words = do {local(@ARGV, $/) = "/path/to/file"; <>});
|
|---|