May 2011 Archives

Perl 6 IRL (In Real Life)

A couple of weeks ago a ran into a real life situation where Perl 6 was able to greatly simplify my life. I was in the process of importing some Canadian postal codes from a PDF document where the data was presented like this:

A0A-A0R,D13
A1A-A1G,D11
A1H-A1M,D13
A1N,D11
A1S-A8A,D13
B0C-B0E,D11
B0H-B0W,D10
B1A-B2E,D11
B2G-B2H,D10

Each postal code, or postal code range, was tied to a zone. To store this to a database, I wanted to expand out each of these ranges to capture each value. Causing the firs…

About Jonathan Lloyd

user-pic I blog about Perl.