Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there a more efficient way to do this, and is there a way to get around the file size issue? This is running on a NT machine. Also, I found a bug report on CPAN regarding a similar issue, but didn't understand the solution. I'd appreciate any help as I am just learning Perl and have received no help yet from the other sites I've posted to. Thanks in advance!while(<>) { if(/\[(\d+)\/(\w+)\/(\d+):(.*)\]/){ $filename = "weblog"."-".$3."-".$2; if(-w $filename){ open(LOGFILE,">>$filename") || die "Sorry, could not append $ +filename: $!"; select(LOGFILE); print $_; } else{ open(LOGFILE,">$filename") || die "Sorry, could not create $f +ilename: $!"; select(LOGFILE); print $_; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Large File Size
by davorg (Chancellor) on Aug 01, 2000 at 17:39 UTC | |
|
Re: Large File Size
by lhoward (Vicar) on Aug 01, 2000 at 17:53 UTC | |
|
RE: Large File Size
by mrmick (Curate) on Aug 01, 2000 at 17:53 UTC | |
|
Re: Large File Size
by Anonymous Monk on Aug 01, 2000 at 18:12 UTC | |
|
Re: Large File Size
by Anonymous Monk on Aug 01, 2000 at 19:00 UTC | |
by ArthurDent (Acolyte) on Aug 01, 2000 at 22:43 UTC | |
|
Final Solution
by Anonymous Monk on Aug 02, 2000 at 21:35 UTC | |
|
Re: Large File Size
by ferrency (Deacon) on Aug 01, 2000 at 23:37 UTC | |
|
Re: Large File Size
by nardo (Friar) on Aug 01, 2000 at 18:12 UTC | |
by tye (Sage) on Aug 01, 2000 at 18:49 UTC |