in reply to cron: every nth week

If you're scheduling the script to run every Monday (and only on Monday, or whatever day you're after), then can just see if its the nth week of the month. Here's a version that doesn't use modules (notice there's no real difference between bad input and a day that's not the nth week):
my $nth = shift; die "N must be numeric" if $nth =~ /\D/; die "Day is out of range" if $nth > 5; my ($mday) = (localtime)[3]; my $weeks = int(($mday-1)/7)+1; exit 0 if $weeks == $nth; exit 1;