Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, monks I was thinking about writing a download counter when someone suggested that I use the CGI.pm module to do it.

I was just wondering how I would convert this using CGI.pm I thought the CGI.pm module was for just doing HTML output type stuff?? My question is: How would I start writing a download counter using CGI.pm
$File = $ENV{'QUERY_STRING'}; if ($File =~ /\//) { ($File) = $File =~ /^.*\/([^\/]+)$/g; } $DownloadFile = "$DownloadFileDir/$File"; open (CNT,"+<$Counter") || &endIt; flock (CNT,2); seek (CNT,0,0); @infile = <CNT>;
are there any flaws in the code above?

Replies are listed 'Best First'.
Re: download counter using CGI.pm
by blakem (Monsignor) on Sep 12, 2001 at 23:51 UTC