Just as a little question (I'm not gonna bother starting a new thread), is there any way to get CGI::Carp to give more useful error messages? When I do not include the line and examine the log file, it gives the error message and the line number. But CGI::Carp just reports the extremely...
I think the problem is that you used 'my' with $counter twice. I think that saying my $counter += 1 will overwrite the previous value, giving the variable just a value of 1.
Sorry, I actually made a mistake. The period is a wildcard for ANY character. So if you want a physical period, then escape it: s/\.tga/\.gif/
Sorry for forgetting that ;)
Use the s/ regex, not the tr/ one. I'm pretty sure that your tr/ regexp will do this:
*Replace all periods with a period (no change)
*replace all t's with g's
*Replace all g's with i's
*Replace all a's wth f's.
The s/ one will work fine.
If you don't want anyone to be able to look at your file from the web browser, use the extension .cgi or .pl instead of .txt
It won't be a real CGI or Perl file, but browsers won't read it as they would a text file. Your script will read it the same way as the text file.
If you want to make sure that all of them are real email addresses, try this:
Assuming the email addresses are stored in @EmailAddresses, do this:
for $i (0 .. 4) {
print "Entry number $i is not an email address!" if ($EmailAddresses[$i] !~ /[\w\.-]+\@[\w-]+\.\w{2,}/);
}
Although I don't know of a solution to your problem, the above solution would reload the page in 5 minutes whether the computer was idle or not, wouldn't it?
If you want to check whether the file exists, you would use -e, wouldn't you? -z returns true if the file exists but is zero-size.
I could be wrong, though. But I always use -e to see if the file exists.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.