From: Larry G. <Li...@IS...> - 2003-12-29 15:07:02
|
Hi Jamie, > -----Original Message----- > From: Jamie Cameron > > > I also tried to use a while loop instead of a foreach but I get > > the same results - as I would suspect. > > So this problem only happens for a single log file (mailog), > and works for procmaillog without the code being changed? Perhaps > one of those files has lines ending with \r\n, while the other ends > with just \n I would believe that. I am, however, confused as I have a problem running the code I supplied within reports-lib.pl but when I place that code in an external script (mail-stats.pl) and call that external script from reports-lib.pl, it works. Is it possible that Webmin has the $/ variable set somewhere external to my code? How would I be able to track that? Interesting, I tried the following: egrep 'spamd.*\r.*seconds' /var/log/maillog.1 Dec 21 06:48:30 sisi spamd[5045]: identified spam (16.1/6.0) for merlin:91 in 2.5 seconds, 1085 bytes. Dec 21 07:44:41 sisi spamd[5260]: clean message (-4.5/6.0) for merlin:91 in 3.4 seconds, 3741 bytes. Dec 21 07:48:20 sisi spamd[5295]: identified spam (15.1/6.0) for merlin:91 in 2.8 seconds, 962 bytes. Dec 21 08:09:10 sisi spamd[5560]: clean message (-6.2/6.0) for merlin:91 in 4.0 seconds, 5034 bytes. It would seem that the \r is creating a problem but I just don't get where the $/ variable could be set as I am not setting it. Thanks for the help! Regards, Larry |