home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!ucsbcsl!engrhub!harley
- From: harley@engrhub.ucsb.edu (Harley Hahn,,,HAHN,personal)
- Newsgroups: comp.unix.questions
- Subject: The Fundamental Theorem of Perl
- Message-ID: <7447@ucsbcsl.ucsb.edu>
- Date: 22 Jan 93 03:10:25 GMT
- References: <1993Jan15.230411.2512@nas.nasa.gov> <51845@seismo.CSS.GOV> <1993Jan19.181113.16935@news.eng.convex.com>
- Sender: root@ucsbcsl.ucsb.edu
- Lines: 47
-
- Recently, a simple solution to a sorting problem...
-
- >:The following sort command works just fine:
- >:sort -t. +0n -1 +1n -2 +2n -3 +3n -4
- >:
- >:With some small changes this could sort the internet number anywhere in the
- >:line.
-
- was offered. However, Tom C. showed how for difficult data
- the simple solution might not be enough...
-
- >Really? Please show me how to sort the following lines by the
- >first occurring Internet address on each line:
-
- {omit sample data in which numbers are irregular}
-
- >I believe you cannot without great effort devise a /usr/bin/sort solution
- >where the Internet number falls in different places on different lines, or
- >one in which the host number is a class A or B address in two- or three-dot
- >notation. The following hunk of perl code, on the other hand, manages
- >quite well:
-
- {omit clever Perl program}
-
- ------------
-
- I think I have just figured out the Fundemental Theorem of Perl:
-
- =====================================
- THE FUNDAMENTAL THEOREM OF PERL
- =====================================
-
- As you make a problem more and more complex,
- you will eventually reach the point where it
- becomes necessary to use Perl.
-
- ==================
- Harley's Corollary:
- ==================
- Any problem can be made to require Perl
- by expanding the set of input data to be
- sufficiently complex.
-
- =====================================
-
-
- -- Harley Hahn
-