<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1011710" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1011710</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-help-if-possible#comment-1067406</link>
    <description> &lt;p&gt;Did it work ?!&lt;/p&gt;
 </description>
     <pubDate>Fri, 14 Jul 2000 09:43:47 +0000</pubDate>
 <dc:creator>anti</dc:creator>
 <guid isPermaLink="false">comment 1067406 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>thank you</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-help-if-possible#comment-1067316</link>
    <description> &lt;p&gt;THANKS A LOT!!!!&lt;/p&gt;
&lt;p&gt;    Neil&lt;/p&gt;
 </description>
     <pubDate>Thu, 13 Jul 2000 10:19:13 +0000</pubDate>
 <dc:creator>skirrow</dc:creator>
 <guid isPermaLink="false">comment 1067316 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>OK, I&#039;ll try ...</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-help-if-possible#comment-1067315</link>
    <description> &lt;p&gt;But beware I have no perl at hand, so it all commes from my head.&lt;br /&gt;
(And I&#039;ll go via the shell, since Idon&#039;t want to write a sorter ...)&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;$INFILE=&amp;quot;LOG&amp;quot;;&lt;br /&gt;&lt;br /&gt;system( ( &amp;quot;/bin/sh&amp;quot;, &amp;quot;-c&amp;quot;, &amp;#039;cut -d&amp;quot;|&amp;quot; -f 2 &amp;lt;&amp;#039;.$INFILE.&amp;#039; | sort&amp;nbsp; | uniq -c | sort -n | tail -n 10 | cut -f 2 &amp;gt;TOP10IP&amp;#039; ) );&lt;br /&gt;&lt;br /&gt;open( TOP10IP, &amp;quot;&amp;lt;TOP10IP&amp;quot; );&lt;br /&gt;while( &amp;lt;TOP10IP&amp;gt; ){&lt;br /&gt;	print $_;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Note:&lt;br /&gt;
This is not very fast or resource friendly,&lt;br /&gt;
but I assume this is for your private datamining only anyway, so it will be OK.&lt;/p&gt;
&lt;p&gt;And yes, I thought it would be more code ...&lt;/p&gt;
&lt;p&gt;Anti&lt;/p&gt;
 </description>
     <pubDate>Thu, 13 Jul 2000 09:52:40 +0000</pubDate>
 <dc:creator>anti</dc:creator>
 <guid isPermaLink="false">comment 1067315 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>A tiny hint if possible :o)</title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-help-if-possible#comment-1067229</link>
    <description> &lt;p&gt;Hi,&lt;br /&gt;
Thanks anti!&lt;br /&gt;
  Okay.  Maybe this is asking a bit much!  But I havn&#039;t programmed seriously for over a year so I&#039;m extremely rusty!&lt;/p&gt;
&lt;p&gt;Could you possibly just write the top 10 IPS section?&lt;br /&gt;
All of it, including how to print them.&lt;br /&gt;
It can&#039;t be much code looking at what you showed me!&lt;/p&gt;
&lt;p&gt;       Thanks a lot!&lt;br /&gt;
         Neil&lt;/p&gt;
 </description>
     <pubDate>Wed, 12 Jul 2000 15:40:53 +0000</pubDate>
 <dc:creator>skirrow</dc:creator>
 <guid isPermaLink="false">comment 1067229 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/perl-help-if-possible#comment-1067226</link>
    <description> &lt;p&gt;Just some common tips...&lt;/p&gt;
&lt;p&gt;If you use &quot;|&quot; seperated tables, always end the line with an &quot;|&quot;.&lt;br /&gt;
There is a very good reason for it, but I used to many RDBMS to remember right now.&lt;/p&gt;
&lt;p&gt;Use the system if you can.&lt;br /&gt;
Under UNIX tail, sort, uniq, etc are your friends.&lt;/p&gt;
&lt;p&gt;Last 100 logins:&lt;br /&gt;
tail -n 100 LOGFILE &amp;gt; LAST100&lt;br /&gt;
Last login:&lt;br /&gt;
tail -n 1 LOGFILE &amp;gt; LAST1&lt;br /&gt;
Top 10 IPs:&lt;br /&gt;
cut -d&quot;|&quot; -f 2  TOP10IP&lt;/p&gt;
&lt;p&gt;If you want to do this in pure perl you would use a similar approach.&lt;br /&gt;
Depending on the logfile size you could do it in memory.&lt;br /&gt;
But why bother. Just let the shell to all the work ...&lt;/p&gt;
&lt;p&gt;If you have _tried_ to do it and find some specific problems ask again.&lt;br /&gt;
Nobody can/will help you with &quot;I need the script, please write it.&quot;&lt;/p&gt;
&lt;p&gt;ciao&lt;br /&gt;
Anti&lt;br /&gt;
ps:&lt;br /&gt;
If you really can&#039;t do it, but need it ... buy it ... my price is 250US$/hour (discount for TWF members included).&lt;/p&gt;
 </description>
     <pubDate>Wed, 12 Jul 2000 15:10:00 +0000</pubDate>
 <dc:creator>anti</dc:creator>
 <guid isPermaLink="false">comment 1067226 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
