use strict; use LWP::Simple; my $leagueURL = 'http://sports.yahoo.com/nhl/stats/byposition?pos=C,RW,LW,D'; my $data = get $leagueURL || die "Couldn't get $leagueURL"; while ( $data =~ m||gs ) { my $id = $1; my @stats = ($id); print STDERR "Getting player $id\n"; push( @stats, &getCareer($id) ); push( @stats, &getSplits($id) ); print STDOUT "@stats\n"; sleep(15); } sub getCareer { my ($id) = @_; my $url = "http://sports.yahoo.com/nhl/players/$id/career"; my $data = get $url || die "Couldn't get $url"; return ("gotCareer"); } sub getSplits { my ($id) = @_; my @s = (); my $url = "http://sports.yahoo.com/nhl/players/$id/splits?year=career"; my $data = get $url || die "Couldn't get $url"; return ("gotSplits"); }