Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Runaway CGI script

by kennethk (Abbot)
on Nov 19, 2014 at 18:47 UTC ( [id://1107804]=note: print w/replies, xml ) Need Help??


in reply to Runaway CGI script

I would be very surprised if this script caused your issue. What kind of output do you see if you run the following in a TTY context:
#!/usr/bin/perl use strict; use warnings; my @files = </home/user/Maildir/cur/*>; for (@files){ open(IN, $_); while (<IN>) { last if /The mail system/; } while (<IN>) { if (m#/domain.com$#) { print "\n"; last; } print; } close IN; }
There are a number of methodological changes I'd make to what you've done, particularly adding a check to see if what you are about to open is a file (-f or next; and see -f) and testing the result of the open (open(IN, '<', $_) or die "Open failure on $_:$!\n"), but these shouldn't be the cause of your issue unless you've got an unbelievably large set of subdirectories and have swamped your log file. Which you said you didn't.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-20 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found