A simple Perl
program that count words, characters, and lines from any .txt
file.
Perl
is a high-level, general-purpose, interpreted, dynamic programming language. It was originally developed by Larry Wall in 1987 as a scripting language to make report processing easier. Perl
is known for its powerful text processing capabilities and its eclectic syntax, which supports multiple programming paradigms including procedural, object-oriented, and functional programming. Perl is widely used for system administration, web development, network programming, and more.
To run the word_count.pl
script, follow these steps:
- Open a terminal on your machine.
- Navigate to the directory containing the word_count.pl file.
- Run the script using Perl with the command:
perl word_count.pl <filename>
- Replace
<filename>
with the name of the file you want to analyze.- To use the example file included with this repo, run:
perl word_count.pl count_me.txt
- You will get the following output:
- To use the example file included with this repo, run:
Words: 18
Characters: 95
Lines: 2
For:
This is a total of 18 words with 95 characters (yes blank spaces count)
spanning across 2 lines
Note
This README
provides a brief introduction to Perl, guidance on how to run the script, and links to more comprehensive Perl resources for further reading and learning.
This project is released under the terms of The Unlicense, which allows you to use, modify, and distribute the code as you see fit.
- The Unlicense removes traditional copyright restrictions, giving you the freedom to use the code in any way you choose.
- For more details, see the LICENSE file in this repository.
Author: Scott Grivner
Email: scott.grivner@gmail.com
Website: scottgrivner.dev
Reference: Main Branch