XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
seems like a lot of stuff to install just to count the lines in a file. File::Map is not installed by default on any of the 3 systems I am currently using. and see http://www.perlmonks.org/?node_id=989383 for the problems with large files. there may be other examples. I sense some confusion about what is being discussed here based on all of the responses. Perl is known for having many ways to do the same thing but it does not mean that every one of those ways is a good way to do it. if all you want to know is how many lines are in a file then why would you want to load the entire file in memory (if it even fits) or go thru the mapping process - seems like overkill to me. I wonder if the original post was meant as a discussion about doing a line count without using the *nix wc command. many of the responses seem to be trying to come up with a command line to do the line count. perhaps we as software developers should remember the KISS method and save ourselves a lot of trouble. CPAN is a source of many good tools to solve many problems but sometimes CPAN may be a sledgehammer when all you really are trying to do is push in a thumbtack. In reply to Re^2: Count number of lines in a text file
by Anonymous Monk
|
|