Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: Post Election Day Perl

by amelinda (Friar)
on Nov 09, 2000 at 05:35 UTC ( [id://40666]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    open I,"lynx -dump http://www.cnn.com/ELECTION/2000/results/FL/index.h
    +tml|";
    while(<I>) { @j = split; if($j[1]) {$j[1] =~ s/,//g;}
    ...
    $r
    E
    close M; exit;
    
  2. or download this
    #!/usr/bin/perl -w
    use strict; my $b; my $g; my $r;
    die "lynx failed\n" unless open I,"lynx -dump http://www.cnn.com/ELECT
    +ION/2000/r
    ...
    $r
    E
    close M; exit;
    
  3. or download this
    #!/usr/bin/perl -w
    open I,"lynx -dump http://www.cnn.com/ELECTION/2000/results/FL/index.h
    +tml|";while(<I>){@j=split;if($j[1]){$j[1]=~s/,//g;} if(/Bush/){$b=$j[
    +1];} elsif(/Gore/){$g=$j[1];}} close I;open O,">log";$d=abs($b-$g);if
    +($b==$g){$r="tied!\n";} $b<$g ? $r="Gore: $d\n" : $r="Bush: $d\n";pri
    +nt O "$r";close O;open F,"mfile";$m=<F>;close F;open M,"|sendmail -t"
    +;print M <<E;
    Subject: results
    ...
    $r
    E
    close M; exit
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found