note
b10m
<blockquote><em>
[b10m]:<br />
You use system() to copy a file. Not very Perl'ish ;)
<blockquote><em>
[Detonite]:<br />
I don't know how else to do it (yet). (File::Copy?)
</em></blockquote>
</em></blockquote>
<p>That would work.</p>
<blockquote><em>
[b10m]:<br />
$sdate (and others) will be in this format: 27-7-5, while "2005-07-27" probably makes more sense to international users.
<blockquote><em>
[Detonite]:<br />
I've been doubting that, yeah. I didn't think anyone else will use this, so I just left it this way.
</em></blockquote>
</em></blockquote>
<p>
First of all, you post it here, so someone might be using it already. Secondly, you seem to use that information also in your reply emails (<tt>s/_DATE_FROM_/$sdate/g;</tt>) - and those might reach other mailboxes besides yours ;)
</p>
<blockquote><em>
[b10m]:<br />
Script dies when target start date has not been reached yet.
<blockquote><em>
[Detonite]:<br />
It does? That's a bug. Thanks!
</em></blockquote>
</em></blockquote>
<p>
Before you updated the node, it said "<tt>die("...") if($sdate ne
$cdate)</tt>", so yes, it will die ;) Instead of die'ing, you might
want to print just errors, so when something fails, cron will notify
you. (See the --silent option I suggested before).
</p>
<blockquote><em>
[Detonite]<br />
As I said, it's for the exercise. If I don't code, I won't improve. Plus I wanted to make a shell script first, asked in the CB, and got asked why I didn't make a Perl script ;)
</em></blockquote>
<p>
True, it's good excercise, yet Perl isn't <em>always</em> the right tool ;)
</p>
<div class="pmsig"><div class="pmsig-295259">
-- <br />
[b10m]<br />
<br />
<font size="-3">All code is usually tested, but rarely trusted.</font>
</div></div>
478541
478553