View Search.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Airport::Search; | |
use strict; | |
use warnings; | |
use Data::Dump 'pp'; | |
use feature 'say'; | |
use List::Util qw(min max); | |
my $airport_data = Airport::Data::parse_airports("t/data/airports1.csv"); | |
sub get_name_matching_airports { |
View gist:0cc1f3e32a67ee398b76151cf9ededa7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub get_latlong_matching_airports { | |
my ($parm1, $parm2, $parm3, $parm4) = @_; | |
my %args = ( | |
airports => $parm1, | |
lat => $parm2, | |
long => $parm3, | |
max => $parm4, | |
# @_ # this I was not sure of how it worked in the subroutine with defined keys but undefined values | |
); | |
View findairport_airport_20_search.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Test::More; | |
#use_ok('Some::Module'); # This should be the module you're testing | |
use_ok('Airport::Data'); | |
ok(1, '1 is always true'); | |
is(1, "1", '1 is "1" according to "is"'); |
View csv_arr_of_hashes_return.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Text::CSV qw(csv); | |
use Data::Dumper qw(Dumper); | |
my $filename = 'iata_airports.csv'; | |
my $matching = $ARGV[0]; | |
my @matches; |
View search_airports2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Data::Dump 'pp'; | |
use feature 'say'; | |
use Getopt::Long; | |
use Text::CSV qw(csv); | |