Our first script today consists of two parts:
A simple address book file, containing names, addresses, and phone numbers
A Perl script that prompts you for things to search for, and then prints out any matching addresses
This script makes use of just about everything you've learned so far this week: scalar and hash data, conditionals, loops, input and output, subroutines, local variables, and pattern matching. There's even a function call here and there to make things interesting. And so, without further ado, let's dive in.
The address.pl script is called with a single argument: the address file, called address.txt. Call it on the command line as you have other Perl scripts:
% address.pl address.txt ...