AboutWelcome to Free Software Daily (FSD). FSD is a hub for news and articles by and for the free and open source community. FSD is a community driven site where members of the community submit and vote for the stories that they think are important and interesting to them. Click the "About" link to read more...
It's not often that I write about Perl Scripting on Unix Tutorial, but that's just because I don't script in Perl this much on a regular basis. Today, however, I'd like to share one of the building blocks - a really basic piece of functionality which you'll find really useful in almost any Perl script.
Here's a brief example of applying a regex, drawn from the UNIX command-line utility grep, which searches for a specified pattern among the content of one or more UNIX text files. The command grep -i -E '^Bat' searches for the sequence beginning-of-line (indicated with the caret, [^]), followed immediately by upper- or lowercase letters b, a, and t (the -i option ignores case in pattern matches, so B and b are equivalent, for instance). Hence, given the file heroes.txt:
"I noticed a discussion about Perl on Hacker News this morning. The linked article is about why the author likes Perl. As with all articles of this type, it attracted the usual "Ruby is better!!" comments.
"Moritz Lenz has started a series of blog posts about moving from Perl 5 to Perl 6, including why some design choices were made, and how you can take advantage of some of the Perl 6 features today in Perl 5..."
Perl's 21st anniversary of release is next Thursday, 18 December. Perl 5 is already 14 years old. Though the language has seen many changes since 1994, it can't stand still. Perl 5.10 added many wonderful features and Perl 6 will change the landscape for programming languages, but what's the vision for Perl 5? How can the language stay relevant?
Lately, the Perl language has had less buzz surrounding it than many other languages and development environments, but Perl is still a key component on the Internet.