No, but this one does. Based on the "ass-u-me everything"
one above, it also includes a bugfix so that it shouldn't
break if there is more than one instance of Bush|Gore and
appends to the logfile instead of overwriting. 485 bytes.
#!/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;$l=`tail -n1 log`;@l=split /
+/,$l;$d=abs($b-$g);if($l[1]==$d){die"same\n";}if($b==$g){$r="tied!\n"
+;}$b<$g ? $r="Gore: $d\n" : $r="Bush: $d\n";open O,">>out";print O "$
+r";close O;open F,"mfile";$m=<F>;close F;open(M,"|sendmail -t");print
+ M <<E;
Subject: results
Cc: $m
$r
E
close M;exit;
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|