diff options
Diffstat (limited to 'scripts/acronyms.pl')
-rwxr-xr-x | scripts/acronyms.pl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/acronyms.pl b/scripts/acronyms.pl index 3687f40..d7b890f 100755 --- a/scripts/acronyms.pl +++ b/scripts/acronyms.pl @@ -45,6 +45,18 @@ sub get_stations { return @stations; } +sub get_station { + my ( $name ) = @_; + + my $ds100_match = firstval { $name eq $_->[0] } @stations; + + if ($ds100_match) { + return ($ds100_match); + } + + return get_station_by_name($name); +} + sub get_station_by_name { my ( $name ) = @_; @@ -110,6 +122,16 @@ B<Note:> Station codes may contain whitespace. Returns a list of [station code, station name] listrefs lexically sorted by station name. +=item Travel::Status::DE::IRIS::get_station(I<$in>) + +Returns a list of [station code, station name] listrefs matching I<$in>. + +If a I<$in> is a valid station code, only one element ([I<$in>, related name]) +is returned. Otherwise, it is passed to get_station_by_name(I<$in>) (see +below). + +Note that station codes matching is case sensitive and must be exact. + =item Travel::Status::DE::IRIS::get_station_by_name(I<$name>) Returns a list of [station code, station name] listrefs where the station |