Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

RE: Post Election Day Perl

by Fastolfe (Vicar)
on Nov 09, 2000 at 02:55 UTC ( #40649=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use LWP::Simple;$_=get('http://www.cnn.com');($P,$u,$l)=m~(Bush|Gore)<
    +/\S+\s*<td\s*\S+ \S+edhead">([\d,]{9}).*?([\d,]{9})~s;$u=~s/,//g;$l=~
    +s/,//g;$d=$u-$l;print$d?"$P leads by $d votes!\n":"Tie!\n";
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
            print $l $d?"$P is leading by $d votes\n":"It's a tie!\n";
            $l->close;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://40649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2020-01-21 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?