Dealing with Table Data

To continue the example, for the moment have the recipient of the email simply cut and paste it into your Perl program. Now you'll need a Perl program to read the incoming email. Figure 19.1 is the same as the previous example of table data, except it's marked up a bit to indicate what the Perl script is going to have to deal with.

The data occurs in four distinct blocks:

  • The email header. You can discard this, as it will vary from email system to email system and isn't a reliable source for information.

  • The email address and postal address of the customer. There are two lines for the street address, and in this example the second line is blank.

  • A payment block. This seems to be three sections: a card type, card number, ...

Get SAMS Teach Yourself Perl in 24 Hours THIRD EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.