Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Log Files for CGI Submits

by AltBlue (Chaplain)
on Jul 23, 2008 at 21:06 UTC ( [id://699702]=note: print w/replies, xml ) Need Help??


in reply to Log Files for CGI Submits

You could be lazy and (ab)use File::Temp:
#!/usr/bin/perl use strict; use warnings; use POSIX (); use File::Temp (); my $log = File::Temp->new( UNLINK => 0, DIR => '/the/path/to/your/log/folder/', # isn't this too fancy?! you don't need "nice" file names* ;-) TEMPLATE => POSIX::strftime( 'simplebr_%Y%m%d%H%M%S_XXXX', localti +me ), SUFFIX => '.txt', ); print $log 'foo bar'; close $log;
* I guess your "logs" folder is in fact some kind of (very) poor man's queue. If this is correct, you don't want to *sort* those files on a file name basis because it would be too slow, better use whatever your underlying OS offers you for watching a folder (e.g. Sys::Gamin, Linux::Inotify, SGI::FAM, Win32::ChangeNotify). Anyway, you'll have to take some solid countermeasures in order to avoid trashing your disk. ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://699702]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2025-07-08 13:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.