The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Data::FR::Town - Provides data about french town (INSEE code, ZIP/postal code, name...)


Version 0.01


This module provides basic data about french towns.

    use Data::FR::Town;

    # Multiple ways to get the same town
    my $town1 = Data::FR::Town->new( {insee => "01001"});
    my $town2 = Data::FR::Town->new( {zip => "01400"});
    my $town3 = Data::FR::Town->find( {insee => "01001"});
    my $town3 = Data::FR::Town->find( {zip => "01400"});

    Now you can get data about the selected town, using the getters :

    my $zip = $town1->zip();
    my $name = $town1->name();
    my $cname = $town1->cname();


new ( \%params )

Return a town object selected through the specified parameters.

%params accept two valid keys : 'insee' and 'zip' to specfy the town.

find ( \%params )

Return a town object selected through the specified parameters.

%params accept two valid keys : 'insee' and 'zip' to specfy the town.

insee ()

Return the INSEE code associated to this town

zip ()

Return the zip/postal code associated to this town

article ()

Return the article associated to this town, as some french town may have one. (La Courneuve)

name ()

Return the name of the town The first letter is uppercased the other ones are lowercase

cname ()

Return the capitalized name of the town All letters are (non accentuated) uppercase.

dep ()

Return the department's number

depname ()

Return the department's name


This version is based on the data from the INSEE site :

As this data is free and quite stable, the information about the INSEE code, name are quite accurate.

The information about the postal/zip code is however much more difficult to get AND subject to change.

I'll try to keep the postal/zip codes up to date, but anyone knowing a way to get automatically these data could greatly contribute by telling it (or providing the data)

Don't hesitate to contact me on this subject.

Arnaud (Arhuman) ASSAD, <arhuman at>


Arnaud (Arhuman) ASSAD, <arhuman at>


Please report any bugs or feature requests to bug-data-fr-town at, or through the web interface at I will be notified, and then you'll


You can find documentation for this module with the perldoc command.

    perldoc Data::FR::Town

You can also look for information at:



Copyright 2012 Arnaud (Arhuman) ASSAD.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.