Perl references: create, dereference and debug with confidence
Learn enough to be dangerous with one of Perl’s most powerful features
Read it
How to read a string into an array of characters using split
Perl’s split function has a useful feature that will split a string into characters. This works by supplying an empty regex pattern (“//”) to the split function. This can be used to easily split a word into an array of letters, for example:
Read it
Perl for loops
Perl’s for loops are a powerful feature that, like the rest of Perl can be as concise, flexible and versatile required. This article covers the core features for Perl’s for loops.
Read it
List shortcuts: qw the quote whitespace operator
A popular way to build a list of literal quotes in Perl is to use the quote whitespace operator (qw). It’s terse, versatile and elegant. To see why, let’s look at a typical statement using a list of strings:
Read it
Perl arrays 101 - create, loop and manipulate
Arrays in Perl contain an ordered list of values that can be accessed using built-in functions. They are one of the most useful data structures and frequently used in Perl programming.
Read it
Upgrade your list printing using field separator variables
A typical way to print every element of an array in Perl is using a foreach loop:
Read it
Find the index of the last element in an array
Most Perl programmers know that to find the size of an array, the array must called in a scalar context like this:
Read it
Designing a Search Engine
A couple of months ago, I was approached by a company that I had done some work for previously, and was asked to build them a search engine to index about 200MB of HTML. However, some fairly strict rules…