in reply to Extract numbers.....
If they are strictly identical...this will, stupidly, work:
while (my $line = <DATA>) { next unless ($line =~ /^<a href=/); my @vars = split('&', $line); my ($mid2) = (split('=', pop(@vars)))[1] =~ /^(\d+)/; my $mid1 = (split('=', pop(@vars)))[1]; my $week = (split('=', pop(@vars)))[1]; # do domething with the vars... } __DATA__ blah blah <a href="/f1/show?page=matchup&lid=206&week=8&mid1=2&mid2=8"> more lines
Of course.. this is far away from perfect... and I'm creating a useless array @vars...
Update: you could just use something from CPAN... like the Link Extractor to do the links..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Extract numbers.....
by rob_au (Abbot) on Nov 04, 2001 at 07:50 UTC |