Click here to Skip to main content
15,881,559 members
Articles / Programming Languages / Perl

A Simple Address Book Application in Perl

Rate me:
Please Sign up or sign in to vote.
3.07/5 (8 votes)
12 Apr 20061 min read 31.5K   1.2K   5  
This article includes a simple address book application in Perl.

Sample Image

Introduction

Implements an address book using Perl's OOP capabilities. This provides facilities including searching, sorting, format printing, array manipulation, and I/O.

Background

This project was inspired by an article submitted on the CodeProject website:

Using the Code

There are two dependant files:

  • Entry.pm - This is where the Entry object is defined.
  • addressbook.txt - The database in a flat file. I was going to implement XML but did not have time.

Perl OOP

To use the Entry construct, include the pm file as shown below. This is demonstrated in the project. This project does not completely follow a OOP design. I only had a short period of time to implement this project, but the end result is definitely interesting. I hope it helps beginner Perl programmers to see the nice REGEX capabilities as well as how to integrate OOP into your design. Once again, I would suggest visiting Khurt Williams' article page first if OOP in Perl is what you desire to learn.

PERL
package Entry;

Sample Formatted Sorting Results

First Name: Arthur                   Last Name: Putie Home 
Phone: 923-835-8745                  Mobile Phone:923-812-6789 
Address: 23 Wimp Lane, Kensington    Zip code: 38758 
DOB: 8/31/69                         Salary: 126000.00 

First Name: Popeye                   Last Name: Sailor 
Home Phone: 156-454-3322             Mobile Phone: 156-445-4564 
Address: 945 Bluto Street, Anywhe Zip code: 29358 
DOB: 3/19/35                         Salary: 22350.00 

First Name: Michael                  Last Name: Vasquez 
Home Phone: 555-555-5555             Mobile Phone: 562-554-4545 
Address: 1 Perl ave Pomona Ca        Zip code: 90340 
DOB: 12/1/1976                       Salary: 100000.00

Perl is Cool

The main thing that I enjoyed about learning Perl was the fact that I could create some meaningful code fast. Also, I found that Perl could be developed for reuse and still be fast to implement.

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.

A list of licenses authors might use can be found here.


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --