Take a gander:
#! c:\perl\bin\perl.exe
$| = 1;
use strict;
my ($message,$date,$week,$file);
$date = "04/28";
$week = "4";
$message = "\n****** Player Update ******\n";
$message .= `perl z:\\scripts\\baseball\\players.pl`;
$message .= "\n****** Stat Download ******\n";
$message .= `perl z:\\scripts\\baseball\\stats1.pl $date`;
$message .= "\n****** Weekly Stats Update ******\n";
$message .= `perl z:\\scripts\\baseball\\stats2.pl $week`;
$message .= "\n****** Standings Update ******\n";
$message .= `perl z:\\scripts\\baseball\\stats3.pl`;
$file = $date."OUTPUT";
if (-f $file) {
open(DATA, ">>$file");
} else {
open(DATA, ">$file");
}
print DATA $file;
close(DATA);
exit;
Quick explanation:
players.pl updates player information. No problems.
stats1.pl inserts individual player stats from $date. No problems.
stats2.pl updates teams' stats using individual player stats for $week up to $date. Output to file looks good, but the team stats are not updated with the stats inserted from stats1.pl.
stats3.pl updates team standings using team stats. Output looks good, but of course, nothing is updated since the stats didn't change.
All scripts update a local MSSQL7 db via Win32::OLE and work flawlessly from the command line.
Any suggestions?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.