Travel::Status::DE::IRIS::Stations - Station name to station code mapping
use Travel::Status::DE::IRIS::Stations; my $name = 'Essen Hbf'; my @stations = Travel::Status::DE::IRIS::Stations::get_station_by_name( $name); if (@stations < 1) { # no matching stations } elsif (@stations > 1) { # too many matches } else { printf("Input '%s' matched station code %s (as '%s')\n", $name, @{$stations[0]}); }
version 0.00
This module contains a mapping of DeutscheBahn station names to station codes. A station name is a (perhaps slightly abbreviated) string naming a particular station; a station code is a two to five character denoting a station for the IRIS web service.
Example station names (code in parentheses) are: "Essen HBf" (EE), "Aachen Schanz" (KASZ), "Do Universität" (EDUV).
Note: Station codes may contain whitespace.
Returns a list of [station code, station name] listrefs lexically sorted by station name.
Returns a list of [station code, station name] listrefs matching $in.
If a $in is a valid station code, only one element ([$in, related name]) is returned. Otherwise, it is passed to get_station_by_name($in) (see below).
Note that station codes matching is case sensitive and must be exact.
Returns a list of [station code, station name] listrefs where the station name matches $name.
Matching happens in two steps: If a case-insensitive exact match exists, only this one is returned. Otherwise, all stations whose name contains $name as a substring (also case-insensitive) are returned.
This two-step behaviour makes sure that not prefix-free stations can still be matched directly. For instance, both "Essen-Steele" and "Essen-Steele Ost" are valid station names, but "essen-steele" will only return "Essen-Steele".
None.
List::MoreUtils(3pm)
There is no support for intelligent whitespaces (to also match "-" and similar) yet.
Travel::Status::DE::IRIS(3pm).
Copyright (C) 2014 by Daniel Friesel <derf@finalrewind.org>
This module is licensed under the same terms as Perl itself.
EOF
To install Travel::Status::DE::IRIS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Travel::Status::DE::IRIS
CPAN shell
perl -MCPAN -e shell install Travel::Status::DE::IRIS
For more information on module installation, please visit the detailed CPAN module installation guide.