# set up a schema class using 2 modules that I've written manually (there are more tables; this is just to make sure it works). use MG::Schema::Tables; # * use MG::Schema::Country; # * my $schema = MG::Schema->connect('DBI:mysql:mg', 'jfrm', '???'); #* # Or better, fill the class with table info automatically (using a file called MG/Main.pm with content: #package MG::Main; #use base qw/DBIx::Class::Schema::Loader/; #__PACKAGE__->loader_options( # relationships => 1); #use MG::Main; #& #my $schema = MG::Main->connect('DBI:mysql:mg', 'jfrm', '????'); #& # Query for all countries and put them in an array, my @all_countries = $schema->resultset('Country')->all; # Create a result set to search for countries. foreach my $country (@all_countries) { print "! ".$country->CountryCode." = ".$country->CountryName."
"; }