[6687] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 312 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 16 04:07:24 1997

Date: Wed, 16 Apr 97 01:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 16 Apr 1997     Volume: 8 Number: 312

Today's topics:
     ?? mailto: with libwww <ghouston@scott.net>
     Re: A simple substitution (Abigail)
     Re: A simple substitution <tchrist@mox.perl.com>
     Re: DNS reverse lookup - gethostbyaddr() <e8726057@student.tuwien.ac.at>
     how to get perl handle elm's receive automatically <lufan@hotmail.com>
     Re: Parsing hex characters <gwhassan@prodigy.net>
     Re: Perl vs. C/C++ (James A. Robinson)
     Re: Q: Uniq'ing a list <dbenhur@egames.com>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and <graham.matthews@maths.anu.edu.au>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Michael L. Siemon)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and <graham.matthews@maths.anu.edu.au>
     STDOUT from socket server (Kurt Sterzl)
     Re: What does "UNIX" stand for.. <gerv@chiba.netxn.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 15 Apr 1997 19:41:00 GMT
From: "Customer" <ghouston@scott.net>
Subject: ?? mailto: with libwww
Message-Id: <01bc49d4$f2046540$3003f1cd@test.scott.net>

I'm trying to use libwww to send e-mail.  I've enclosed my test script... 
Any suggestions what I'm doing wrong?

Thanks,
Greg
please reply to ghouston@scott.net

#!/usr/local/bin/perl

use strict;

use HTTP::Request;
use LWP::UserAgent;

my $request = HTTP::Request->new( Post => 'mailto:ghouston@scott.net');
$request->header(Subject => "testing mailto");
$request->content("This is the body of the message\n\n- A. Perl");

my $useragent = new LWP::UserAgent;
my $response = $useragent->request( $request );

print "is_success() = ", $response->is_success(), "\n";
print "Code: ", $response->code(), "\n";
print "Message: ", $response->message(), "\n";
print "Headers: ", $response->headers(), "\n";
print "Content: ", $response->content(), "\n";




------------------------------

Date: Wed, 16 Apr 1997 04:58:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: A simple substitution
Message-Id: <E8psHp.4IJ@nonexistent.com>

On 15 Apr 1997 13:53:24 GMT, Tom Christiansen wrote in
comp.lang.perl.misc <URL: news:5j018k$r3p$4@csnews.cs.colorado.edu>:
++
++ You know something, USING tr/// FOR CASE TRANSLATION IS WRONG!
++ 
++ To see this kind of thing written really annoys me.  And it doesn't
++ make my cousin Renie or the Caqon City Chamber of Commerce very happy.
++ Face it, anything that's seven-bit only is a naove fagade that won't
++ hold up in the real world of even writing English properly, and you
++ don't have to be an ilitist with a learnhd bent to realize this.

What's wrong with "tr/a-z\xe0-\xf6\xf8-\xfe/A-Z\xc0-\xd6\xd8-\xde/;"?

++ This will do what you want better, I believe:
++ 
++     s/\b(\w)/\u$1/g;
++ 
++ and won't screw up on the words that aren't 7-bit only.  (You may
++ need 'use locale' in 5.004, though it works fine currently.)

Well... that doesn't work on my computer. \w doesn't seem to recognize
letters in the upper half of the character set. (Nor does \u uppercase
those letters, or does \b treat them as letters.)

#!/usr/local/bin/perl -w

my $foo = my $bar = "a s d k u g f v a";

$foo =~ tr/a-z\xe0-\xf6\xf8-\xfe/A-Z\xc0-\xd6\xd8-\xde/;
$bar =~ s/\b(\w)/\u$1/g;

print $foo, "\n", $bar, "\n";
__END__

A S D K U G F V A
a s d k u g f v A


Abigail


------------------------------

Date: 16 Apr 1997 05:29:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A simple substitution
Message-Id: <5j1o2v$b3k$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, abigail@fnx.com writes:
:What's wrong with "tr/a-z\xe0-\xf6\xf8-\xfe/A-Z\xc0-\xd6\xd8-\xde/;"?

People don't know about it, and I bet you're assuming ISO 8859-1.  
What about other locales?

:Well... that doesn't work on my computer. \w doesn't seem to recognize
:letters in the upper half of the character set. (Nor does \u uppercase
:those letters, or does \b treat them as letters.)

Your locale may not be set.  Is $ENV{LC_CTYPE} set to "iso_8859_1" 
or anything at all?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    I think I'm likely to be certified before Perl is...  :-)
        --Larry Wall in <1995Feb12.061604.6008@netlabs.com>


------------------------------

Date: Wed, 16 Apr 1997 08:00:52 +0200
From: Klaus Johannes Rusch <e8726057@student.tuwien.ac.at>
Subject: Re: DNS reverse lookup - gethostbyaddr()
Message-Id: <33546B14.A76@student.tuwien.ac.at>

Roland wrote:
> I'am trying desperatly to convert a IP-Address to the corresponding
> hostname with a perl-script...
> All my experiments with gethostbyaddr() just returning a empty string
> and I cannot find any examples of how to do, where can I find some
> information about ?

Tested on OS/2, SunOS and AIX:

#!/usr/bin/perl

$remote = '193.170.75.14';
@abcd = split (/\./, $remote);
$adr = pack('C4', @abcd);
($name, $aliases, $addrtype, $length, @addrs) = gethostbyaddr($adr,2);

print "$remote is $name\n";


Note you will need to have a nameserver (or an entry in your /etc/hosts
file) and an address that actually resolves to a name.

Klaus Johannes Rusch
--
e8726057@student.tuwien.ac.at, KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/


------------------------------

Date: Wed, 16 Apr 1997 17:40:54 GMT
From: Maverick <lufan@hotmail.com>
Subject: how to get perl handle elm's receive automatically
Message-Id: <33550F26.31BB@hotmail.com>

hi all,


I want to write a perl script to auto-detect
elm's new arrival and parse it into several files

has perl has this ability to auto-detect? or I shall
daemon programming?



rgds
robert


------------------------------

Date: Tue, 15 Apr 1997 22:48:49 +0000
From: Greg Hassan <gwhassan@prodigy.net>
To: Alejo Balingit <ab20@tntvax.ntrs.com>
Subject: Re: Parsing hex characters
Message-Id: <335405D1.7265A426@prodigy.net>

Alejo Balingit wrote:
> 
> The following data comes from the mainframe:
> 
>  ^Z|XYZ     | ^Z| 00001.| ^Y|1994-05-10 00:00:00:000|   ? ^Z|ABCD    |
> ^Y|1994-05-10 00:00:00:000| ^Z|331 | ^Z|    | ? ^B||
> 
> The output looks like this:
> 
> XYZ     | 00001.|1994-05-10 00:00:00:000||ABCD    |1994-05-10 00:00:00:000|331
> |   |||
> 
> Notice that the hex characters are removed including the trailing delimiter,
> but if thare is a "?" in the field AND a hex character, the delimiter is not
> deleted.  What can I use to check/remove hex characters?


does that C program produce the required output?  seems
like a strange way to delimit files.  This will get
rid of all the control characters:

perl -pi -e 's/\cZ|\cY|\cB//g' filename

then you can do whatever you want to do with the question marks.

-Greg

-- 
============================================
                Greg Hassan
          The Independent Solution
 Web Developer (CGI, Java, C, Perl, Oracle)
           http://www.hassan.com/        
    gwhassan@prodigy.net, 1-415-969-5856
============================================


------------------------------

Date: 16 Apr 1997 00:32:16 -0700
From: jimr@aubrey.stanford.edu (James A. Robinson)
Subject: Re: Perl vs. C/C++
Message-Id: <5j1va0$ll@aubrey.stanford.edu>

In article <JASON.97Apr4140435@quake.cs.odu.edu>,
>
>	Which doesn't matter in a project of any size.  Almost all
>your resources in a full blown application go to design, bug fixing,
>and improvements.  Coding is the easy part and the time it takes is

Bug fixing and improvements *are* coding.  You probably have less of a
bug fixing cycle in Perl because it gives you such good error
information and doesn't just dump an ugly little core file.


>perl programs commonly took 200 times longer to run an exact
>translation of the C code.  

Huh, I can't say I've seen it take *that* much off.  I've only seen a
real improvement when I had to go over an enormous chunk of data over
and over again while doing string searches.  And while this may not be
the case for everyone, it took me a week to write in C what I had in
perl within a day.

>as long, I'm not going spend a million on a computer and get the same
>performance as a competitor that spent $500,000.

True, if your goal is absoluter performance, and you can throw lots of
developer hours into the project, C++ is a good choice.  However, we
find ourselves moving from C++ to Java because we can't afford all the
developer time it takes to maintain our C++ libraries and programs.

>would take a couple of hours in C.  I do still use C when reliability
>is important since perl is much more bug prone due to its lack of
>strict data typing and function prototypes.

Hmm, I think you must be missing something.  Perl in general is much
better for projects where you need to validate the data.  Now, if you
mean forgetting that your integer is not a float or something, that is
simply a programmer problem (i.e. learn the language before attempting
to any critcal thing in it).

>errors, but I would much rather have a program crash then to happily
>run for days producing completely wrong answers.

Days?  What kind of stuff are you doing that can't take a bit of
sample input?


> We are talking about C++ and the STL has these data structures
>along with the automatic memory handling.  Even if you don't have a
>template library, it doesn't take long to write it once and never
>think about it again.

We must be thinking of different C++ languages...  If you want any
real sort of extendibility in your libraries, you need to throw lots
of time into modeling it (I'm talking about real complex objects
here). And then you get the wonderful problem of shared library
linking against older programs. Perl spares us from the latter.

>If you ever tried to do highly advanced data
>structures in perl (beyond simple lists of lists, strings, etc),
>you'll end up pulling you hair out at the pile of nasty syntax.

What do you consider a highly advanced data structure?  I guess a
project I just finished would fall into your lists of lists of strings
catagory, but I had to make a data structure of sections in a table of
contents, each section containing article records, each article record
containing author records.  This took about 30 minutes to code in
perl, but it would have taken much longer in C++, even with STL
(which, if you use it, gives you portability problems because not
every platform has it).

Overall, the only advantage I see to C++ is speed of execution, and
for in-house projects that isn't worth the development time required
to write and maintain it.  As to projects for selling, If it is an
application that needs to be portable and/or needs a lot of networking
support, I see more advantage to doing it in Java then C++.


Jim

-- 
Jim Robinson <jim.robinson@stanford.edu> - http://highwire.stanford.edu/~jimr/
HighWire Press -- Stanford University


------------------------------

Date: Tue, 15 Apr 1997 18:51:28 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: p25a003@rrz.uni-hamburg.de
Subject: Re: Q: Uniq'ing a list
Message-Id: <335430A0.2D1B@egames.com>

[mail&post]
Andreas Steffan wrote:
> Would someone please be so kind and tell me how to uniq a list
> in perl without using the UNIX 'uniq' command ?

This one liner will do it if you don't care about
list order:
   @uniq = keys( %{ +{ map { ($_,1) } @list } } );

It makes an anonymous hash using list data as keys, 
then retreives those keys.

If you want to preserve order and be a little more
efficient try:

sub uniq {
  my %test = ();
  return map { 
           if ($test{$_}) { () }       # null if exists
           else { $test{$_}=1; ($_) }  # mark and return
         } @_;
}

@uniq = &uniq(@list);

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"



------------------------------

Date: Wed, 16 Apr 1997 15:07:04 +1000
From: Graham Matthews <graham.matthews@maths.anu.edu.au>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <33545E78.4983@maths.anu.edu.au>


Charles Lin wrote:
>     If one had to choose a single type for everything, a string is a
> pretty good choice.   Why not a number?  How would you represent a
> string with a number?   You can represent a number with a string.
> Just put quotes around it.
Graham Matthews  <graham.matthews@maths.anu.edu.au> wrote:
>Oh come on -- if you have a a finite alphabet then there is a bijection
>between the natural numbers and strings over that finite alphabet. For
>example if you N symbols in your alphabet, A ..., then AA is represented
>by N+1.
Paul Wilson wrote:
> This is, of course, a long-established and deep theoretical result,
> but I think for these purposes it's pretty much irrelevant, or trivially
> true of most existing implementations already, depending on how you look
> at it.

No its not irrelevant. The question was why did JO chose the "everything
is a string" paradigm, when he could have chosen the "everything is an
integer", or "everything is a list" paradigm? This correspondence shows
the stupidity of the "everything is a string is so powerful" argument.

graham
-- 
                       I was gonna be your Romeo
                      You were gonna be my Juliet
                  These days you don't wait on Romeos
                    You wait on that welfare cheque


------------------------------

Date: Wed, 16 Apr 1997 01:59:20 -0400
From: mls@panix.com (Michael L. Siemon)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <mls-1604970159200001@mls.dialup.access.net>

In article <33545E78.4983@maths.anu.edu.au>, Graham Matthews
<graham.matthews@maths.anu.edu.au> wrote:

+No its not irrelevant. The question was why did JO chose the "everything
+is a string" paradigm, when he could have chosen the "everything is an
+integer", or "everything is a list" paradigm? This correspondence shows
+the stupidity of the "everything is a string is so powerful" argument.

Sorry, but that does not follow. Bijections are all very well (hey, I'm
a topologist by training :-)), but human predispositions are relevant
here, and most people are more intuitively at home with "reading" a
string "1.0 + 3" as a sequence of characters than, e.g., processing a
text into a Goedel enumeration, (or more directly to the point, going
the other way, from the integer to the text.)

Simplicity and uniformity *are* relevant. One might argue that it matters
not *what* primitive representation is used, but I would laugh at anyone
who seriously thought that non-string representations were "simpler" than
strings.

Try representing the _Iliad_ as either an integer or a list. Just try;
I want to see what kind of idiocies you will commit. That it is possible
I willingly acknowledge; that it is sane, I seriously doubt.

Humans reading strings which *happen* to contain conventional represent-
ations of numbers are happy to make mental conversions. The converse is
*not* true -- "reading" an arbitrary integer as (by some abstruse mapping)
a text string is utterly weird and non-standard. It is quite hopeless for
documentation, for training, and for maintenance. And in case you were a
bit out of it, LANGUAGE is what humans ordinarily use in communication.
It is human readers (and writers) who matter, when we are talking about
programming.
-- 
Michael L. Siemon                             mls@panix.com        

"Green is the night, green kindled and apparelled.
It is she that walks among astronomers."
                                      -- Wallace Stevens


------------------------------

Date: Wed, 16 Apr 1997 16:50:13 +1000
From: Graham Matthews <graham.matthews@maths.anu.edu.au>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <335476A5.18EA@maths.anu.edu.au>


> In article <33545E78.4983@maths.anu.edu.au>, Graham Matthews
> +No its not irrelevant. The question was why did JO chose the "everything
> +is a string" paradigm, when he could have chosen the "everything is an
> +integer", or "everything is a list" paradigm? This correspondence shows
> +the stupidity of the "everything is a string is so powerful" argument.
Michael L. Siemon wrote:
> Sorry, but that does not follow. Bijections are all very well (hey, I'm
> a topologist by training :-)), but human predispositions are relevant
> here, and most people are more intuitively at home with "reading" a
> string "1.0 + 3" as a sequence of characters than, e.g., processing a
> text into a Goedel enumeration, (or more directly to the point, going
> the other way, from the integer to the text.)

You have missed the point! I am arguing against the claim that
"everything is a string is so *powerful*". This claim is rubbish since
"everything is a list" is just as powerful. I agree that "everything is
a string" might be more convenient, humanly intelligible, etc, but thats
a different question. My point is that most people claim "power" for the
"everything is a string" approach, when in fact they mean "convenience,
etc". So lets be precise and argue convenience, reliability, etc and
forget this marketing hype of "power".

This leads to the question of why do you think the "everything is a
string" approach is so convenient. As far as I can see its less
convenient than allowing a mixture of typed objects.

> Simplicity and uniformity *are* relevant. One might argue that it matters
> not *what* primitive representation is used, but I would laugh at anyone
> who seriously thought that non-string representations were "simpler" than
> strings.

What about list representations?

graham
-- 
                       I was gonna be your Romeo
                      You were gonna be my Juliet
                  These days you don't wait on Romeos
                    You wait on that welfare cheque


------------------------------

Date: 16 Apr 1997 06:23:03 GMT
From: kurts@mincom.com (Kurt Sterzl)
Subject: STDOUT from socket server
Message-Id: <5j1r87$e19$1@pithy.mincom.oz.au>


G'day

A quick rundown on what we want to acheive:

We have three scripts; client, server and a collection script.

The client attaches to the server with to arguments, a user name and a
function name to perform. e.g. ./client -u mims -r info1

The server (multi server version), started as root, fires of the
collection script (su - mims -c .....).  The collection script will
continue running until it receives function requests on STDIN.

I don't know how to send the function request to the collection script
from the server.

I have been able to call the Collection script without command line
options, and it does return all values to the client script.

Any help would be greatly appreciated.

All the code is inserted below. 

################## Server script ##################################

#!/usr/local/bin/perl5 -w
use FileHandle;
use Socket;
use Carp;

#
# KILL routines
#
$SIG{INT} = \&sig_handler;
$SIG{HUP} = 'IGNORE';

sub spawn;      # forward declaration
sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }

my $port = "patrol_tp"          if ( ! $port );
my $port = getservbyname($port,'tcp');
my $proto = getprotobyname('tcp');
socket ( LISTEN_SOCKET, PF_INET, SOCK_STREAM, $proto ) || die "socket: $!";
setsockopt ( LISTEN_SOCKET, SOL_SOCKET, SO_REUSEADDR, 1 ) || die "setsockopt: $!";

bind ( LISTEN_SOCKET, sockaddr_in($port, INADDR_ANY)) || die "bind: $!";
listen ( LISTEN_SOCKET, SOMAXCONN ) || die "listen: $!";

my $waitedpid = 0;
my $paddr;

sub REAPER {
    $SIG{CHLD} = \&REAPER;      # if you don't have sigaction(2)
    $waitedpid = wait;
    logmsg "reaped $waitedpid" . ($? ? " with exit $?" : "");
}

$SIG{CHLD} = \&REAPER;

$count=1;
for ( ;($paddr=accept(NEW_SOCKET,LISTEN_SOCKET)); close NEW_SOCKET) {
    my($port,$iaddr)=sockaddr_in($paddr);
    my $name=gethostbyaddr($iaddr,AF_INET);

    logmsg "connection from $name [",inet_ntoa($iaddr), "] at port $port";

    # handle any incoming variables from a client script.
    NEW_SOCKET->autoflush(1);
    $instance=<NEW_SOCKET>;     # instance name - su - instance name
    $sreqs=<NEW_SOCKET>;        # requests (arguments for _inf script)

    while ( ( $key, $collsocket ) = each( %forked ) ) {
        logmsg "array: $key - $collsocket vs $instance";
        last if ( $key eq $instance );
    }
    while ( each ( %forked ) ) { }      # to reset "each" to start of array

    if ( $key eq $instance ) {
        logmsg "This key $key has already started the program";
    printf ( STDOUT $sreqs );
    } else {
        spawn sub {
            print "entered spawn sub at ", scalar localtime, "\n";
            exec '/usr/local/src/tp/test.pl'
                or confess "can't exec test.pl: $!";
        };
    }
}

sub spawn {
    my $coderef=shift;
    unless (@_ == 0 && $coderef && ref($coderef) eq 'CODE') {
        confess "usage: spawn CODEREF";
    }
    my $pid;
    if (!defined($pid = fork)) {
        logmsg "cannot fork: $!";
        return;
    } elsif ($pid) {
        logmsg "begat $pid";
        $forked{ $instance } = $count;
        $count++;
        return;         # i'm the parent
    }
    # else i'm the child -- go and spawn

    open(STDIN, "<&NEW_SOCKET")         or die "can't dup client to stdin";
    open (STDERR, ">&NEW_SOCKET")       or die "can't dup stdout to stderr";
    exit &$coderef();
}

sub sig_handler {
    logmsg "Signal SIG@_ caught";
    close ( NEW_SOCKET );
    close ( LISTEN_SOCKET );
    exit;
}

#############################################################

###################### Client Script #######################

#!/usr/local/bin/perl5
require 5.002;
require "getopts.pl";
 
use Socket;
use FileHandle;

&Getopts ( 'u:r:' );
$suid = $opt_u ."\n" if ( $opt_u );
$reqs = $opt_r ."\n" if ( $opt_r );

my ($remote,$port_number,$iaddr,$paddr,$proto,$line);
chop ( $host = `hostname` );
$remote = $host;
$port   = "patrol_tp" if ( ! $port );
($name,$aliases,$port,$proto)=getservbyname($port,'tcp');
die "No port" unless $port;
$iaddr  = inet_aton($remote)    or die "no host: $remote";
$paddr  = sockaddr_in($port,$iaddr);
$proto=getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
connect(SOCK, $paddr)   or die "connect: $!";

SOCK->autoflush(1);
print SOCK $suid;
print SOCK $reqs;
while ($line = <SOCK>) {
  print $line;
}

close(SOCK)     or die "close: $!";


############################################################

#################### Collection Script #####################

#!/usr/local/bin/perl5
require "flush.pl";
print STDOUT "Ready!\n";
print STDERR "_READY_\n";
for ( ; ; ) {
    exit if ( ! ( $req = <STDIN> ) );
    chop ( $req =~ tr/[a-z]/[A-Z]/ );
    print STDOUT $req, "...\n" if ( $dbg );
    $SIG{'ALRM'}  = 'sig_handler';
    SWITCH: {
        $req =~ /^LOGOUT/     && do { exit; };
        $req =~ /^PATROL1/    && do { &do_patrol1;
                                      last SWITCH;
                                    };
        print STDERR "_NOTHING_\n";
    }
    print STDERR "_END_\n";
    flush ( STDERR ); # for fun
}
exit;

sub do_patrol1 {
    printf ( STDERR "Doing PATROL1\n" );
    printf ( STDERR "MSDAILY=NONE\n" );
    printf ( STDERR "TCP=1\n" );
    printf ( STDERR "MIMS=3013l\n" );
    printf ( STDERR "ORACLE=7.1.2.3\n" );
}


--
bye
Kurt
--
Kurt Sterzl (BE-Comp Sys) Special Projects, Systems Integration
MINCOM Pty Ltd  PO Box 72  Stones Corner  QLD  4120 
Email: kurts@mincom.com  Ph: +61 7 3364 9999  Fax: +61 7 3394 2844


------------------------------

Date: Tue, 15 Apr 1997 21:45:39 -0700
From: gerv <gerv@chiba.netxn.com>
Subject: Re: What does "UNIX" stand for..
Message-Id: <33545973.443CE11E@chiba.netxn.com>

This is a multi-part message in MIME format.
--------------1316A29AB203FD8DAB378CD0
Content-Type: multipart/alternative; boundary="------------04BEC8FE33D1EB99B9B12505"


--------------04BEC8FE33D1EB99B9B12505
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

dave massie wrote:

> unix is a pun.  the developers (ritche, et. al.) had been working on
> a
> dod project building an operating system called multix.
>
> they were thinking they wanted to build a smaller operating system
> for
> their own use.  so, if it was smaller than multix, it must be unix.
>
> UNIx, get it?
>
> Al Christians wrote:
> >
> > If you don't stand for something, you'll stand for anything.
> >
> > Al



--------------04BEC8FE33D1EB99B9B12505
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML><BODY>
dave massie wrote:

<BLOCKQUOTE TYPE=CITE>unix is a pun.&nbsp; the developers (ritche, et.
al.) had been working on a
<BR>dod project building an operating system called multix.
<BR>
<BR>they were thinking they wanted to build a smaller operating system for
<BR>their own use.&nbsp; so, if it was smaller than multix, it must be unix.
<BR>
<BR>UNIx, get it?
<BR>
<BR>Al Christians wrote:
<BR><I>&gt;</I>
<BR><I>&gt; If you don't stand for something, you'll stand for anything.</I>
<BR><I>&gt;</I>
<BR><I>&gt; Al</I>
</BLOCKQUOTE>
&nbsp;&nbsp;

</BODY>
</HTML>

--------------04BEC8FE33D1EB99B9B12505--

--------------1316A29AB203FD8DAB378CD0
Content-Type: text/html; charset=us-ascii; name="hoax.html"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="hoax.html"
Content-Base: "http://www.apexsc.com/vb/hoax.html"

<html>
<head>
<title>Cheap Laughs - C is a hoax!</title>
</head>

<body text="#000000" bgcolor="#FFFFFF">
<table cellpadding=10>
<tr><td valign=middle><a href=index.html><img src=img/smalmast.gif
	border=0 height=92 width=211></a></td>
<td valign=middle><h2><font color="#CC0000">
C is a hoax!
</font></h2></td></tr></table>



<blockquote>
Purely in the spirit of fun and for the sole purpose of stirring up
hate and discontent, we here at Carl & Gary's have drudged up this 
old gem poking fun at C (and UNIX in general). Note that this is not for 
real! (We have to say that so we don't get sued, you know). If you 
have some yuks to share with the vb community, please send them to 
us at <a href="mailto:vb-admin@apexsc.com">vb-admin@apexsc.com</a>. 
<i>- Carl & Gary</i>
</blockquote>

<hr size = 7>
<blockquote>
<H1>Creators Admit Unix and C Language Hoax</H1>
<p>
In an announcement that stunned the computer industry, Ken Thompson,
Dennis Ritchie and Brian Kernighan admitted the Unix operating system and C 
programming language created by them is an elaborate prank, kept alive
over 20 years. Speaking at the recent UnixWorld Software Development Forum,
Thompson revealed the following:
<p>
<blockquote>
"In 1969, AT&T had just terminated their work with the GE/Honeywell/AT&T 
Multics project. Brian and I had started work with an early release of
Pascal from Professor Niklaus Wirth's ETH labs in Switzerland and we were
impressed with its elegant simplicity and power. Dennis had just finished reading
'Bored of the Rings', a National Lampoon parody of the Tolkien's 'Lord of the
Rings' trilogy.
<p>
As a lark, we decided to do parodies of the Multics environment and
Pascal. Dennis and I were responsible for the operating environment. We looked
at Multics and designed the new OS to be as complex and cryptic as possible
to maximize casual users' frustration levels, calling it Unix as a parody
of Multics, as well as other more risque allusions. We sold the terse
command language to novitiates by telling them that it saved them typing."
<p>
Then Dennis and Brian worked on a warped version of Pascal, called 'A'.
'A' looked a lot like Pascal, but elevated the notion of the direct memory
address (which Wirth had banished) to the central concept of the language. This
was Dennis's contribution, and he in fact coined the term "pointer" as an 
innocuous sounding name for a truly malevolent construct. 
<p>
Brian must be credited with the idea of having absolutely no standard
I/O specification: this ensured that at least 50% of the typical commercial 
program would have to be recoded when changing hardware platforms. Brian
was also responsible for pitching this lack of I/O as a feature: it allowed
us to describe the language as "truly portable".
<p>
When we found others were actually creating real programs with A, we
removed compulsory type-checking on function arguments. Later, we added a notion
we called "casting": this allowed the programmer to treat an integer as
though it were a 50k user-defined structure. When we found that some programmers
were simply not using pointers, we eliminated the ability to pass structures
to functions, enforcing their use in even the Simplest applications.
<p>
We sold this, and many other features, as enhancements to the efficiency
of the language. In this way, our prank evolved into B, BCPL, and finally
C. We stopped when we got a clean compile on the following syntax:<pre>
    for (;P("\n"),R-;P("|"))for(e=3DC;e-;P("_"+(*u++/8)%2))P("|"+(*u/4)%2); 
</pre>
At one time, we joked about selling this to the Soviets to set their
computer science progress back 20 or more years. Unfortunately, AT&T and other US 
corporations actually began using Unix and C. We decided we'd better
keep mum, assuming it was just a passing phase. In fact, it's taken US companies
over 20 years to develop enough expertise to generate useful applications using
this 1960's technological parody.
<p>
We are impressed with the tenacity of the general Unix and C programmer.
In fact, Brian, Dennis and I have never ourselves attempted to write a
commercial application in this environment. We feel really guilty about the chaos, 
confusion and truly awesome programming projects that have resulted from
our silly prank so long ago."
</blockquote>
<p>
Dennis Ritchie said: "What really tore it (just when AIDA was catching
on), was that Bjarne Stroustrup caught onto our joke. He extended it to
further parody, Smalltalk. Like us, he was caught by surprise when nobody
laughed. So he added multiple inheritance, virtual base classes, and later ...
templates. All to no avail. So we now have compilers that can compile 100,000 lines
per second, but need to process header files for 25 minutes before they get
to the meat of "Hello, World".
<p>
Major Unix and C vendors and customers, including AT&T, Microsoft, 
Hewlett-Packard, GTE, NCR, and DEC have refused to comment on the 
announcement. Officials of Borland International, a leading vendor of 
object-oriented tools, including Turbo Pascal and Borland C++, stated
they suspected this for a couple of years.
<p>
In fact, the notoriously late Quattro Pro for Windows was originally
written in C++. Borland CEO Del Yocam said: "I'm told that, after two and a half
years of programming, and massive programmer burn-out, we recoded the whole
thing in Turbo Pascal in three months. It's fair to say that Turbo Pascal saved
our bacon back then". Another Borland spokesman said that they would
continue to enhance their Pascal products, and halt further efforts to develop
C/C++.
<p>
Professor Wirth of the ETH institute and father of the Pascal, Modula 2
and Oberon structured languages, cryptically said "P.T. Barnum was right."
He had no further comments.
<p>
</blockquote>

<p>
<hr size=7>
<p>
<center>
<p>
<font size=2>
<map name="navmap">
<area coords="1,1,59,59" href="index.html">
<area coords="60,1,125,59" href="search.html">
<area coords="425,1,482,59" href="suggest.html">
<area coords="127,1,182,59" href="whatsnew.html">
<area coords="184,1,230,59" href="news.html">
<area coords="231,2,302,59" href="sites.html">
<area coords="304,2,377,59" href="market.html">
<area coords="378,2,424,59" href="files.html">
</map>
<center>
<a href="img/toolbar.map"><img 
ismap usemap="#navmap" src="img/toolbar.gif" border=0
width=483 height=60 ALT="Navigation Toolbar"></a>
<p>
<a href="index.html"><img src="img/cgvbhome.gif" height=34 width=119 border=0></a>
<br><font size=-2><i>Copyright (c) Carl Franklin and Gary Wisniewski,
1994-1997.  All rights reserved.</i>
<br>Design and production courtesy
<a href="http://www.gui.com.au/gui/">GUI Online Productions</a></font>
</center>
</body>
</html>


--------------1316A29AB203FD8DAB378CD0--



------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 312
*************************************

home help back first fref pref prev next nref lref last post