Football::League::Match - A single footie match
use Football::League::Match; my $match = Football::League::Match->from_soccerdata($data); my $final_year_of_season = $match->final_year_of_season; my $division = $match->division; my $hometeam = $match->home_team; my $awayteam = $match->away_team; my $homescore = $match->home_score; my $awaycore = $match->away_score; my $result = $match->result; my Time::Piece $date = $match->date;
This will create a little object with when passed data about a footie match.
Currently, the only format the data can ve passed in is that defined by that supplied by
http://www.soccerdata.com
my $fyos = $match->final_year_of_season;
This will return the final year of the season in which the match took place.
my $division = $match->division;
This is the divison the match took place in.
my $home_team = $match->home_team;
The home team.
my $away_team = $match->away_team;
The away team.
my $home_score = $match->home_score;
The number of goals the home team scored.
my $away_score = $match->away_score;
The number of goals the away team scored.
my $result = $match->result;
This is the result in 2-1 type form.
my Time::Piece $date = $match->date;
This is the date of the match as a Time::Piece object.
The data supplied by soccerdata is in the form:
1,2,3,4,5,6,7
1 = final year of season (4 digit) 2 = division (P/1/2/3) 3 = home team (12 xharacters) 4 = home score (2 digits) 5 = away team (12 characters) 6 = away score (2 digits) 7 = match date (YYYYMMDD)
Well, this isn't really an inspired (or inspiring) moudle. As you may (or may not) guess, this is part of A Bigger Picture.
o Parse different match formats, perhaps screen scraped from some site every saturday night.
Craig McLaughlan has a lot to answer for. Mona, mostly.
There was a thread on london.pm mailing list about working in a vacumn - that it was a bit depressing to keep writing modules but never get any feedback. So, if you use and like this module then please send me an email and make my day.
All it takes is a few little bytes.
(Leon wrote that, not me!)
Stray Toaster, <coder@stray-toaster.co.uk>
Copyright 2003 by Stray Toaster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Football::League::Match, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Football::League::Match
CPAN shell
perl -MCPAN -e shell install Football::League::Match
For more information on module installation, please visit the detailed CPAN module installation guide.