| 1 | # -*- perl -*- | ||
| 2 | # | ||
| 3 | # Author: Gisbert W. Selke, TapirSoft Selke & Selke GbR. | ||
| 4 | # | ||
| 5 | # Copyright (C) 2025--2026 Gisbert W. Selke. All rights reserved. | ||
| 6 | # This package is free software; you can redistribute it and/or | ||
| 7 | # modify it under the same terms as Perl itself. | ||
| 8 | # | ||
| 9 | # Mail: gws@cpan.org | ||
| 10 | # | ||
| 11 | package Map::Tube::Muenchen; | ||
| 12 | 1 | ▶ | use 5.14.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 1 | ▶ | use version 0.77 ( ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 1 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | our $VERSION = version->declare('v0.1.4'); | ||
| 19 | |||
| 20 | =encoding utf8 | ||
| 21 | |||
| 22 | =head1 NAME | ||
| 23 | |||
| 24 | Map::Tube::Muenchen - Interface to the Muenchen (Munich) U- and S-Bahn and tram maps. | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | 1 | ▶ | use File::Share ':all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | 1 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | has xml => ( is => 'ro', default => sub { return dist_file('Map-Tube-Muenchen', 'muenchen-map.xml') } ); | ||
| 33 | |||
| 34 | with 'Map::Tube'; | ||
| 35 | |||
| 36 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | use Map::Tube::Muenchen; | ||
| 39 | my $tube = Map::Tube::Muenchen->new( ); | ||
| 40 | |||
| 41 | my $route = $tube->get_shortest_route( 'Olympiazentrum', 'Maxmonument' ); | ||
| 42 | |||
| 43 | print "Route: $route\n"; | ||
| 44 | |||
| 45 | =head1 DESCRIPTION | ||
| 46 | |||
| 47 | This module allows to find the shortest route between any two given tube stations in Munich. | ||
| 48 | All interesting methods are provided by the role L<Map::Tube>. | ||
| 49 | |||
| 50 | =head1 METHODS | ||
| 51 | |||
| 52 | =head2 CONSTRUCTOR | ||
| 53 | |||
| 54 | use Map::Tube::Muenchen; | ||
| 55 | my $tube = Map::Tube::Muenchen->new( ); | ||
| 56 | |||
| 57 | The only argument, C<xml>, is optional; if specified, it should be a code ref | ||
| 58 | to a function that returns either the path the XML map file, or a string | ||
| 59 | containing this XML content. The default is the path to F<muenchen-map.xml> | ||
| 60 | that is a part of this distribution. For further information see L<Map::Tube>. | ||
| 61 | |||
| 62 | =head2 xml( ) | ||
| 63 | |||
| 64 | This read-only accessor returns whatever was specified as the XML source at | ||
| 65 | construction. | ||
| 66 | |||
| 67 | =head1 ERRORS | ||
| 68 | |||
| 69 | If something goes wrong, maybe because the map information file was corrupted, | ||
| 70 | the constructor will die. | ||
| 71 | |||
| 72 | =head1 BUGS | ||
| 73 | |||
| 74 | Please report any bugs or feature requests through the web interface at | ||
| 75 | L<https://github.com/gwselke/Map-Tube-Muenchen/issues>. I will be | ||
| 76 | notified and then you'll automatically be notified of progress on your | ||
| 77 | bug when (and if) I make changes. | ||
| 78 | |||
| 79 | =head1 AUTHOR | ||
| 80 | |||
| 81 | Gisbert W. Selke, TapirSoft Selke & Selke GbR <gws@cpan.org> | ||
| 82 | |||
| 83 | =head1 COPYRIGHT AND LICENCE | ||
| 84 | |||
| 85 | The data for the map were taken from the relevant Wikipedia pages. | ||
| 86 | The module itself is free software; you may redistribute and/or modify it under the same terms as | ||
| 87 | Perl itself. | ||
| 88 | |||
| 89 | =head1 SEE ALSO | ||
| 90 | |||
| 91 | L<Map::Tube>, L<Map::Tube::GraphViz>. | ||
| 92 | |||
| 93 | =cut | ||
| 94 | |||
| 95 | 1; | ||