Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

RE: Post Election Day Perl

by amelinda (Friar)
on Nov 09, 2000 at 05:35 UTC ( #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
Node Status?
node history
Node Type: note [id://40666]
help
Chatterbox?
and the web crawler heard nothing...

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