<?xml version="1.0"?>
<?xml-stylesheet href="/App_Themes/Rss/Rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:snippetcenter="http://www.snippetcenter.org/">
<channel>
	<title>snippetcenter.org Snippet-Feed - Perl</title>
	<link>http://www.snippetcenter.org/</link>
	<description>Die neuesten Snippets in  Perl</description>
	<language>de-de</language>
	<copyright>snippetcenter.org</copyright>
	<generator>Hinweis: Dies ist ein RSS-Dokument zum Lesen in deinem RSS-Reader. Klick für mehr Infos.</generator>

	<image>
		<url>http://www.snippetcenter.org/Library/Media/Public/button_88x31.png</url>
		<title>snippetcenter.org</title>
		<link>http://www.snippetcenter.org/</link>
		<width>88</width>
		<height>31</height>
	</image>
	
	<item>
     <title><![CDATA[The Pascal Triangle]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/the-pascal-triangle-s1866.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[This Perl script prints the Pascal Triangle. You can choose the depth of the triangle.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/the-pascal-triangle-s1866.aspx]]></link>
</item>

<item>
     <title><![CDATA[Multi-level Hashing for record sort / selection]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/multi-level-hashing-for-record-sort-selection-s1860.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[# Multi-level Hasing in Perl Hashing is a great way to solve problems of sorting and selection. Hashing can replace the process of sorting over a group of records in a file, selecting unique information for a field, or set of fields.However, for hashing to be really useful, we need the ability to be able to hash on more than one key.  Perl's referencing capabilities make this multi-level hashing possible.# This snippet shows how to use multi-level hashing to # reduce a problem of sorting and selecting, to simply # reading a file one record at a time, and then # writing out the results.# Assume you have a directory full of log files. Each # file contains entries that look like this:## 18:14:58, 08-03-2003,00a0f8a44618,4## where the first number is a Time Stamp, the second# is a Date, the third is a MAC address, and the # last is a Counter of some kind associated with# this MAC address for this Date / Time stamp. For # each Date, there can be multiple Time Stamps and # multiple MAC addresses, each with their associated# Counter value. What we want to do is sort thru # the file, and for each Date and each MAC address, # we want to find the maximum Counter value logged for# that Date / MAC combination. We might also want # to note the Time Stamp associated with that # maximum value. But the key point is, we want to # find only one value for each &lt;Date, MAC address&gt; # combo.## The long way of doing this would be to read # each entry, and then compare its Date and MAC address# against our currently stored info as maintained in # some data structure. If the current record# is unique, then we would add it to the data structure.# If not, then we would compare the Counter value for # this &lt;Date, MAC address&gt; entry, and update our data# structure if it is greater.# Using Perl's multi-hashing, we can combine all these # operations into simply reading the file, and# hashing each record contents into one data structure.# We use the hash to ensure that we only store one value# for each &lt;Date, MAC address&gt; combo.# This script uses a hash called %maxCnt. %maxCnt is a # hash of MAC addresses. It also contains a reference # to a second hash which is the Date stamp.# Basically, each MAC address becomes a key at the # top level, and for each MAC address we create a hash # of Date stamps. Then, for each {MAC}{Date} combination, # we store only the largest Counter value associated with # that MAC. This two-level hashing allows us to uniquely# store each &lt;MAC, Date&gt; combo, and eliminates# any messy searching and sorting.# Once we have hashed all the records into %maxCnt,# we can now print a report for each MAC# address that lists all the Dates that there is data # for that MAC, and for each Date we list the maximum # Counter value associated with that MAC address. A# sample of the output would look like this:# 00a0f84d4a8d - #	04-21-2003 : 2#	04-22-2003 : 2#	04-23-2003 : 3# 00a0f8a44618 - #	08-03-2003 : 4#	08-04-2003 : 4# Note that this multi-level hash referencing model # could be extended to multiple keys to go beyond# the two levels given here.# Ok, let's begin...]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/multi-level-hashing-for-record-sort-selection-s1860.aspx]]></link>
</item>

<item>
     <title><![CDATA[smbwall]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/smbwall-s1854.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Operates like 'wall', but sends the message to all connected by SMB machines (Samba servers or Windows with WinPopup or Messaging Service). Useful for UPS power alarms.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/smbwall-s1854.aspx]]></link>
</item>

<item>
     <title><![CDATA[smbwall]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/smbwall-s1853.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Operates like 'wall', but sends the message to all connected by SMB machines (Samba servers or Windows with WinPopup or Messaging Service). Useful for UPS power alarms.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/smbwall-s1853.aspx]]></link>
</item>

<item>
     <title><![CDATA[rotate.pl]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/rotatepl-s1849.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Rotates files a bit like syslog. But got more features.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/rotatepl-s1849.aspx]]></link>
</item>

<item>
     <title><![CDATA[last-check.pl]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/last-checkpl-s1839.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Checking wtmp for dead users, strange locked user activity and unknown user logins. Tested on Debian GNU/Linux 3.1 (woody)]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/last-checkpl-s1839.aspx]]></link>
</item>

<item>
     <title><![CDATA[eWhois - Extended Whois]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/ewhois-extended-whois-s1838.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Extended Whois for querying InterNIC and the source Registrar. Queries InterNIC for the interested domain. If found, offers user option to query Registrar holding the domain contact info. Suitable for Telnet access only at this time. Need security work for web based use.How-to located at: http://www.evolt.org/index.cfm?menu=8&amp;cid=617&amp;catid=17]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/ewhois-extended-whois-s1838.aspx]]></link>
</item>

<item>
     <title><![CDATA[rotateApacheLogs]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/rotateapachelogs-s1832.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Rotates Apache log files. Script works as is on Mac OS X, though could easily be tweaked to work on any UNIX platform using Apache.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/rotateapachelogs-s1832.aspx]]></link>
</item>

<item>
     <title><![CDATA[rotateCatalinaLogs]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/rotatecatalinalogs-s1828.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Rotates all log files for the Tomcat servlet container, keeping the five most recent and deleting the rest.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/rotatecatalinalogs-s1828.aspx]]></link>
</item>

<item>
     <title><![CDATA[Test internet connection with ping]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/de/test-internet-connection-with-ping-s1824.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[This script uses a fixed url to ping to and test if it can &quot;see&quot; the internet. Depending on the result it will quit or wait to see if the connection improves]]></description>
     <link><![CDATA[http://www.snippetcenter.org/de/test-internet-connection-with-ping-s1824.aspx]]></link>
</item>



</channel>
</rss>
