Not sure if this has been answered yet - I just saw the list go
bunta from backlog, but anyways ...

Lance Hoffmeyer wrote:

> I wrote a script that moves and renames folders and the beginning
> of each month.
> The problem is that when I print the new names out they appear as
> 
> Listserv.Info-Cyrus.2002-January
> 
> but when the program actually runs the names come out as
> 
> Listserv.Info-Cyrus.2002-0

[Snippity]

> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isday) = localtime(time);
> $year +=1900;

> if ($mon==1){$cmonth='January'};

Ahem.  $mon runs from 0..11, not 1..12.

> my $date=$year.-$cmonth;

$cmonth wasn't being set.  For defensive programming, initialising
$cmonth to "Not Set" before your multiway "if" would have shown
you the problem.

-- 
Regards,
  Daryl Tester,  Software Wrangler and Bit Herder, IOCANE Pty. Ltd.

"Now is the Winter of our Discount Tent."  -- The Red Green Show

Reply via email to