Click here to Skip to main content
Click here to Skip to main content
Go to top

A simple address book application in Perl

, 12 Apr 2006
Rate this:
Please Sign up or sign in to vote.
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 inluding 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 dependent 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.

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, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Michael Vasquez
Software Developer
United States United States
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 12 Apr 2006
Article Copyright 2006 by Michael Vasquez
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid