xaokitten has asked for the wisdom of the Perl Monks concerning the following question:
The problem I'm facing is that tomorrow, when it tries to count from 7 days ago to tomorrow, although it will reach 1, it will not pattern match what I want it to in the file. I need to find a way to get CurDay to go from 25 26 27 28 29 30 31 1. The same will hold true for the next month as well, of course I'm told there's a Julian Date function or library out there but cannot seem to find it. I'm very much a novice at this and would appreciate any help that you all can give. If you can solve this w/o getting too obfuscated (such that a novice like myself can understand it) I'd appreciate that as well. Thanks! Xaoforeach $file (@filenames) { open (IN,"$file") || die "Cannot open \"$file\" for input: $!. +\n"; @log_in = <IN>; close IN; print "Processing $file . . .\n"; init_vars(); foreach $ln (@log_in) { if ($alreadymatched) { $logfile[$count] = $ln; $count++; } else { do { if ($ln =~ /^$month:$curday/) { $alreadymatched = 1; $logfile[0] = $ln; } $curday++; } until ($alreadymatched); } } open (IN,">done.$file") || die "Cannot open \"$file\" for outp +ut: $!."; foreach $writelog (@logfile) { print IN $writelog; } close IN; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: End of Month Conversions For Date
by chromatic (Archbishop) on Apr 01, 2000 at 10:43 UTC | |
|
Re: End of Month Conversions For Date
by little_mistress (Monk) on Apr 01, 2000 at 06:42 UTC | |
|
Re: End of Month Conversions For Date
by httptech (Chaplain) on Apr 01, 2000 at 18:33 UTC | |
|
RE: End of Month Conversions For Date
by vroom (His Eminence) on Apr 01, 2000 at 09:53 UTC | |
|
Re: End of Month Conversions For Date
by btrott (Parson) on Apr 03, 2000 at 05:56 UTC | |
|
Re: End of Month Conversions For Date
by xaokitten (Novice) on Apr 01, 2000 at 11:29 UTC |