[6655] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 280 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 11 13:17:19 1997

Date: Fri, 11 Apr 97 10:00:25 -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           Fri, 11 Apr 1997     Volume: 8 Number: 280

Today's topics:
     <img src="../../cgi-shl/activity.pl"> <dbaker@dkburnap.com>
     @INC prob <igandham@prestel.net>
     Re: Assigning a List to an Array Element (Eric D. Friedman)
     Crypt function doesn't appear to work <jthistle@cancom.net>
     Re: Crypt function doesn't appear to work (Eric D. Friedman)
     Easy Perl Cookie Question. (Dico Reyers)
     Re: Icon vs. Perl (was: No GUI environment for Perl?) <dfan@harmonixmusic.com>
     interface web-database <bchrist@cme.nist.gov>
     Re: LWP - again... <merlyn@stonehenge.com>
     Name of SUID'ed perl script on Solaris? (Brian Wheeler)
     Re: Name of SUID'ed perl script on Solaris? (Casper H.S. Dik - Network Security Engineer)
     Re: OOP & perl (Eric D. Friedman)
     Parsing a file backwards <hls@hpfitst2.fc.hp.com>
     Re: Pattern matching.... (Andrew M. Langmead)
     Re: perl and multithreading (Malcolm Beattie)
     Perl execute on load? <dbaker@dkburnap.com>
     Perl for AS/400? (Bob Hogue)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and <erik@naggum.no>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and <prasadm@not4u.polaroid.com>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Henry Baker)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (John Ousterhout)
     Re: Unix and ease of use  (WAS: Who makes more ...) (Steve Mading)
     Re: Unix and ease of use  (WAS: Who makes more ...) <tim@a-sis.com>
     Re: Unix and ease of use  (WAS: Who makes more ...) <tim@a-sis.com>
     Re: Unix and ease of use  (WAS: Who makes more ...) <tim@a-sis.com>
     Re: Unix and ease of use (WAS: Who makes more ...) (Ian T Zimmerman)
     What's wrong with Lisp? (WAS:  Reply to Ousterhout's... <prasadm@not4u.polaroid.com>
     Re: why can't arg 1 to shift be split? <merlyn@stonehenge.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 9 Apr 1997 13:25:19 GMT
From: "David Baker" <dbaker@dkburnap.com>
Subject: <img src="../../cgi-shl/activity.pl">
Message-Id: <01bc44e9$69417ee0$c7a3bece@micronclientpro.dkburnap.com>

I am using this in a frameset to auto execute a cgi.  It works ok with
Netscape, but IE wants to load the cgi twice.  This cgi is used for
tracking and the double load issue wont cut it.

Any ideas as to why this is happening?

Thanks,

David


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

Date: Fri, 11 Apr 1997 15:59:33 +0100
From: Iqbal Gandham <igandham@prestel.net>
Subject: @INC prob
Message-Id: <334E51D5.1C31@prestel.net>

Hi

I am running a job from cron, but it doesn't want to work.

>From the command line the perl prog works fine.

It requires a prog. called find.pl. 

When run from cron the error I get is


Can't locate ./find.pl in @INC at
/usr/local/etc/httpd/cgi-bin/quota/quota.pl line 19.

How do I tell it where it is. Does cron search throug a different path

Thanks
Iqbal
igandham@prestel.net


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

Date: 11 Apr 1997 15:39:56 GMT
From: friedman@medusa.acs.uci.edu (Eric D. Friedman)
Subject: Re: Assigning a List to an Array Element
Message-Id: <5ilm0c$8gb@news.service.uci.edu>

[mailed, posted]

In article <334DCB0E.4016@nwu.edu>, John Putnam  <jputnam@nwu.edu> wrote:
>Howdy,
>
>Is there a way to have an array of lists or an associative array with a
>list as a data element?

Strange, the documentation which came with my copy of perl has not one,
not two, but >three< man pages devoted in varying degrees to this very
topic!  Did yours not include these?

perlref     Perl references 
perldsc     Perl data structures intro
perllol     Perl data structures: lists of lists

If you'd read those - a good idea before posting to Usenet - you'd
know that you can assign a reference to a list to a hash or another
list.

That is,

my @list = qw(Read The Fine Manual);

my @otherlist;

$otherlist[0] = [ @list ] ; # A reference to list is now in subscript 0
                            # of @otherlist

hope this helps,
Eric
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: 11 Apr 1997 15:47:10 GMT
From: "Jeff Thistle" <jthistle@cancom.net>
Subject: Crypt function doesn't appear to work
Message-Id: <01bc468e$cb154380$78c9140a@jeff.cancom.ca>

I've written a routine that is _supposed_ to encrypt a string that a user
enters and add it to a .passwd file for use by NCSA Basic Authentication.

The program updates the mentioned .passwd file with a line of the form

<user>:<encrypted string>

but when I try and access the protected directory the username/password
combination does not work.  However, when I add entries to the .passwd file
at the command line with htaccess it works fine.

This is the snippet I'm using to do the encryption:

$Salt = int(rand(100))+1;
$Encrypted = crypt ($String,$Salt);

What the heck am I doing wrong?

Jeff Thistle
jthistle@cancom.net


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

Date: 11 Apr 1997 16:03:13 GMT
From: friedman@medusa.acs.uci.edu (Eric D. Friedman)
Subject: Re: Crypt function doesn't appear to work
Message-Id: <5ilnc1$9ce@news.service.uci.edu>

[mailed, posted]

In article <01bc468e$cb154380$78c9140a@jeff.cancom.ca>,
Jeff Thistle <jthistle@cancom.net> wrote:
>This is the snippet I'm using to do the encryption:
>
>$Salt = int(rand(100))+1;
>$Encrypted = crypt ($String,$Salt);
>
>What the heck am I doing wrong?

This script does what you want.  Perhaps a look through it
will help determine the source of your problem?  Perhaps not. :-)

best,
Eric

#!/dcs/bin/perl5 -w
# fastpass.pl - friedman@uci.edu
# Prompts user for a password and returns it in encrypted form.

use strict;
use subs qw(randalphanum);

srand(time|$$);
if ($#ARGV < 0) {chop($a = <STDIN>);} else {$a = shift;}
print (crypt($a,(randalphanum . randalphanum)). "\n");

sub randalphanum {
    my $r = rand(63);
    if (($r >= 0) && ($r <=9)) {
        return $r;
    } elsif (($r >= 10) && ($r <= 35)) {
        $r =~ tr/10-35/a-z/;
        return $r;
    } elsif (($r >= 36) && ($r <= 61)) {
        $r =~ tr/36-61/A-Z/;
        return $r;
    } elsif ($r == 62) {
        return ".";
    } else {
        return "/";
    }
}
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Fri, 11 Apr 1997 15:45:40 GMT
From: dico@peionline.com (Dico Reyers)
Subject: Easy Perl Cookie Question.
Message-Id: <334e59fa.5776936@news1.pei.sympatico.ca>

Hello there...

My problem:

I have a web page and I want it to send the visitor a cookie when they
arrive.  

The way that I want to do this is in a server side includes call.  So
when the person comes to the page, the page executes a SSI call that
sends the cookie to the client.  How do I do this?

#!/usr/local/bin/perl

print "Content-type: text/html\n\n";

Now what do I print to the browser?  (say for example that I only want
to print the NAME=VALUE item, calling it customer=myself .)


and after all that is said and done, how do I read this cookie, using
much the same (server side includes) method.  And simply outputting
the cookie to the screen? 

I have looked around the internet for such information but I keep
finding stuff that uses librarys, I want to have everything hard coded
into my perl script.

Any help would be appreciated.

Thanks in advance,

~Dico Reyers

dico@peionline.com


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

Date: 11 Apr 1997 11:15:59 -0400
From: Dan Schmidt <dfan@harmonixmusic.com>
Subject: Re: Icon vs. Perl (was: No GUI environment for Perl?)
Message-Id: <wk4tddvbdc.fsf@turangalila.harmonixmusic.com>

rdd@access4.digex.net (R. D. Davis) writes:

| Does anyone care to comment, in an unbiased manner, on the issue of
| Perl versus Icon?  Are there others here who have used both?  Both
| seem like rahter nice languages... perhaps someone should create a
| hybrid of the two, allowing one to have at least three ways of
| accomplishing the same thing using the same language.

Icon is a neat language, with some interesting constructs that will be
strange to people familiar only with traditional programming languages.
For example, most data-passing is done with "generators."  You can call
a function (or built-in operator) multiple times and it will generate a
new value each time until it "fails."  The concept of failure is built
into the language and is distinct from the concept of returning a false
Boolean value.  Backtracking is also built in to the language and
dovetails nicely with generators.

Icon is quite nice for text processing, although you do it quite
differently from in Perl.  Instead of using regexps everywhere,
you have a cursor on your string and move it back and forth,
matching expressions and munging the string.  For some problems,
this is a more natural way of processing a string than "the Perl
way" (although, since TMTOOTDI as always, you can simulate the
Icon approach in Perl; it's just not as natural).

Icon is a very antisocial language (in the terminology of Camel 2); it
doesn't talk to other programs, and even dealing with the filesystem
is pretty limited.  So it's not really suited for sysadmin kinds of
tasks.  For a text-processing application, it is a good choice.

Anyway, I highly recommend learning Icon, whether you need to use it or
not, since it's a really neat language :) For more info, the official
web page is at http://www.cs.arizona.edu/icon/www/

Disclaimer: my Icon experience is limited to reading the manual and
writing a couple of test programs.  Despite my comments above, I use
Perl for all the things that I could use Icon for.

-- 
     Dan Schmidt        How should I know if it works?  That's what beta
Harmonix Music Systems  testers are for.  I only coded it.
dfan@harmonixmusic.com                            -- Linus Torvalds
  dfan@alum.mit.edu


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

Date: Fri, 11 Apr 1997 11:32:07 -0400
From: Bochenek Christophe <bchrist@cme.nist.gov>
Subject: interface web-database
Message-Id: <334E5976.446B9B3D@cme.nist.gov>

Hi,

I am working on interfaces between web and C++_objectstore database.

I have already made an HTML program which refers to a perl program.
The perl program executes my C++ program which must be compiled before,
and prints on web the result of C++ program.
(I don't know why, but it seems impossible to make a perl program which
make a C++ program compile and execute). 
The C++ program just prints "hello".


But now I have a database with an object, and I would like to retrieve
it on web. 
On command line, I can make two executables: one to create the database
with an object, and one to retrieve the object, and that runs...
I would like that my perl program just retrieves the object I created
on command line. But, instead of writing on web page:

empretr: opening database empretr.db
empretr: beginning transaction
empretr:   retrieving employee id from database root: 1180
empretr: finished transaction
empretr: closed database empretr.db

only the first line is written on web, and that's all. That means, that
the perl program can't open the database created on command line.
How can I do that?

	Christophe


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

Date: 11 Apr 1997 07:50:19 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Alex Schajer <schajer@dircon.co.uk>
Subject: Re: LWP - again...
Message-Id: <8c4tddy5p0.fsf@gadget.cscaper.com>

>>>>> "Alex" == Alex Schajer <schajer@dircon.co.uk> writes:

Alex> Hi,
Alex> I'm trying to user the LWP library and in particular the HTTP/Header
Alex> part.
Alex> All I want to do is go through a list of URL's and check when they were
Alex> last modified. It says in the LWP manual user 

Alex> if ($h->last_modified < time - 60 *60 {
Alex> ...
Alex> }

	use LWP::UserAgent;
	use HTTP::Request;
	my $ua = new LWP::UserAgent;
	
	my @url_list = qw(
		http://www.perl.org/
		http://www.perl.com/perl/
	);
	
	for my $url (@url_list) {
		my $request = new HTTP::Request("GET", $url);
		my $response = $ua->request($request);
		printf "%40s %s\n", $url,
			scalar localtime $response->last_modified;
	}
	
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 508 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 11 Apr 1997 15:27:56 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: Name of SUID'ed perl script on Solaris?
Message-Id: <5ill9s$c2p@dismay.ucs.indiana.edu>


I'm writing a script on solaris that needs to be suid.  since I symlink it
with different names, I need to know what name I'm being called as.  I'm
getting back "/dev/fd/4" in $0 which I assume is solaris' implementation of
secure suid scripts.  Is there a way I can get the real program name?  

Thanks!

-- 
Brian Wheeler
bdwheele@indiana.edu


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

Date: 11 Apr 1997 15:43:26 GMT
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Name of SUID'ed perl script on Solaris?
Message-Id: <casper.860773662@uk-usenet.uk.sun.com>

bdwheele@indiana.edu (Brian Wheeler) writes:

>I'm writing a script on solaris that needs to be suid.  since I symlink it
>with different names, I need to know what name I'm being called as.  I'm
>getting back "/dev/fd/4" in $0 which I assume is solaris' implementation of
>secure suid scripts.  Is there a way I can get the real program name?  

No, there isn't.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


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

Date: 11 Apr 1997 15:30:40 GMT
From: friedman@medusa.acs.uci.edu (Eric D. Friedman)
Subject: Re: OOP & perl
Message-Id: <5illf0$89j@news.service.uci.edu>

[mailed, posted]

In article <334C76AC.19CE@tx.technion.ac.il>,
Allon Henig  <ahenig@tx.technion.ac.il> wrote:
>Hi,
>	I'm looking for the best Internet source to study OOP in perl.
>	Do you have any idea ?

Sure, I recommend http://www.perl.org/CPAN/doc/manual/html/pod/index.html

Specifically, perltoot (Tom's Object Oriented Tutorial)
			  perlbot  (00 Tricks and Examples)
	and       perlobj  (Objects)

HTH,
Eric
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Fri, 11 Apr 1997 09:42:15 -0600
From: Heather <hls@hpfitst2.fc.hp.com>
Subject: Parsing a file backwards
Message-Id: <334E5BD7.69AE@hpfitst2.fc.hp.com>

How do I open a file from within a perl script and parse it from the
bottom up, as opposed to top down, which seems to be the default.

Thanks,
Heather


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

Date: Fri, 11 Apr 1997 15:01:12 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Pattern matching....
Message-Id: <E8HB21.L7t@world.std.com>

Sam Mingolelli <slmingol@kodak.com> writes:

>	$pattern="(\S+).*\s(\w+)\s(\w+)\s+(\w+)\s(\S+)\s(\S+)" ;
>	($security,$size,$month,$day,$time_or_year,$filename)=/$pattern/ ;
>	print "$pattern\n" ;

>My goal is to do a pattern match without having to designate the pattern
>on
>the same line with the variables which I intend to store them in.
>Is this possible?

As long as you keep in mind the effects that backslashes have inside
quoted strings. (You probably don't want double quotes.)

You also probably want to check out the /o regular expression
modifier, which greatly speeds up regular expressions containing
variables. (Details are in the perlre and perlop man pages.)
 

-- 
Andrew Langmead


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

Date: 11 Apr 1997 15:06:23 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: perl and multithreading
Message-Id: <5ilk1f$444@news.ox.ac.uk>

In article <334D5CEB.1634@fusionmm.com>,
Scott Gargash  <scottg@fusionmm.com> wrote:
>The thought occurred to me that it's possible to replace the debugger
>script with one of my own choosing. If my subroutine got called after 
>each line of perl, it should be possible to write my own thread
>scheduler
>(execute a line from script 1, then execute a line from script 2, 
>continuing in this manner until both scripts complete, with atomic 
>blocks to make things thread safe). This should work if it were possible
>to maintain independent stacks for each script to do context switches.

It's actually more than just a stack: there's a whole lot of perl
internal variables which have to be per-thread instead of global (e.g.
(mail stack, {context, scope, save, tmps} stack, current op, curpad).

>
>Does anyone know if this is possible? Or does anyone have any 
>better ideas?

Multithreading is being merged in to perl after 5.004 is out (the
original work was done against 5.001m but more important things
took precendence for the perl core). It uses a fairly small number
of threading primitive macros which currently have definitions for
the POSIX threads API (and for old-draft/DCE threads). Adding a
"fake" scheduler for platforms without O/S thread support is on the
ToDo list (and, in fact, a proof of concept version "Plthread"
showed it could be done a couple of years ago).

--Malcolm

-- 
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"Widget. It's got a widget. A lovely widget. A widget it has got." --Jack Dee


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

Date: 9 Apr 1997 12:46:26 GMT
From: "David Baker" <dbaker@dkburnap.com>
Subject: Perl execute on load?
Message-Id: <01bc44e3$fa9ba2e0$c7a3bece@micronclientpro.dkburnap.com>

How can I get a Perl script to activate when a document is loaded?  SSI is
not an option.

Thanks,

David


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

Date: 11 Apr 1997 15:03:33 GMT
From: bob@cis.ysu.edu (Bob Hogue)
Subject: Perl for AS/400?
Message-Id: <5iljs5$h6b@news.ysu.edu>

Is Perl availabe for the AS/400 platform?  If so, could someone point me
to a site where I could find it?  Thanks for any help.


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

Date: 11 Apr 1997 15:02:26 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <3069759746565482@naggum.no>

* Bert Robbins
| AT&T/Bell Labs, when they still owned Unix, did a good job of giving away
| source code to educational institutions in the late seventies and early
| eighties.

really?  when AT&T/Bell Labs sent out the famous tapes, they had four
requirements imposed on the agreement:

    NO ADVERTISING
    NO SUPPORT
    NO BUG FIXES
    PAYMENT IN ADVANCE

this pretty much built the foundation for Unix user groups, and thus grew
the popularity of Unix -- no thanks to AT&T.  in fact, AT&T's lawyers
didn't want to license Unix out at all at the time, but felt they had to
because of their legal battles and the antitrust suits that were in the
budding.  we can blame the divestiture for the spread of Unix.

| The smart compaines jumped on the C bandwagon, ...

this seems at least as dubious as your first claim.

| Long live Perl!

and this more than any...

#\Erik
-- 
I'm no longer young enough to know everything.


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

Date: Fri, 11 Apr 1997 11:30:06 -0400
From: "M. Prasad" <prasadm@not4u.polaroid.com>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <334E58FE.7B82@not4u.polaroid.com>

Bert Robbins wrote:
> 
> I think that a large factor that contributed to the C language
> becomming so popular and being the language of choice for
> development was due to the tremendous number of poeple that
> were turned out by the colleges and universities that had
> experience with C.

I don't think so -- at first Pascal was the big wave at
colleges and universities in the wake of "Goto-less
programming".  C took over from Pascal, slowly.

They often _chose_ to change a course being
taught in Pascal/Fortran or Assembly, to C.  I
recall when an "introduction to systems programming"
course at my university started getting taught in C
instead of the assembly language it was traditionally
taught it.  I am sure the teachers would have considered
Pascal for it if they could have.  Teaching in assembly is
not very efficient, only necessary sometimes.
But using Pascal or Fortran just wasn't feasible.
The desire here was not C per se, but just getting
away from assembly.  C happened to provide a
real alternative to assembly.  And it happened
to be the only real alternative.  Hence
the popularity.


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

Date: Fri, 11 Apr 1997 16:41:52 GMT
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <hbaker-1104970841520001@10.0.2.1>

In article <E8H3sq.Jt6@research.att.com>, ark@research.att.com (Andrew
Koenig) wrote:
> In article <01bc45d3$cdf47fa0$03d3c9d0@wjh_dell_133.dazsi.com> "Bill
House" <bhouse@dazsi.com> writes:
> > Hype alone won't make an intelligent shopper buy, ...
> 
> But hype alone will sometimes make the intelligent shopper's boss' boss buy,
> which is the same thing from the hype merchant's viewpoint.
> 
> I've seen the phenomenon in action as long as I've been involved
> in computing, which is more than a quarter century at this point.
> It applies equally to hardware, software, languages, tools, and
> methodologies.

Amen!

Dogfood: That which a dog eats, but his master buys.


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

Date: 11 Apr 1997 16:08:57 GMT
From: ouster@tcl.eng.sun.com (John Ousterhout)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5ilnmp$rg9@engnews2.Eng.Sun.COM>

In article <5ihaol$n3g@Masala.CC.UH.EDU>, cosc19z5@Bayou.UH.EDU (cosc19z5@bayou.uh.edu) writes:
|> ...
|>
|> As for Tcl, it's there for one reason and one reason only -- strong
|> corporate backing.  We've got a powerful company that wants to
|> make a quick buck and therefore is using its clout to force
|> Tcl down our throats.  This is the same tactic used by charlatans
|> like Micro$oft.  Indeed that's the only possible explanation
|> as to why a glorified text preprocessor would even get a second
|> look -- that and the fact that it is riding on the coattails
|> of Tk.

Sorry for taking so long to respond to this comment, but I couldn't stop
laughing long enough to compose a response.  I wish your accusation were
true, but I'm afraid you are a bit out of touch.  Apparently you haven't
heard of a language called Java, which is the main thing Sun is pushing
these days?  We're a small player in comparison.  Also, how do you explain
the 100,000 or so people who learned Tcl while I was still a lowly
professor at Berkeley?  Was that just a powerful university trying to
make a quick buck and using its clout to force Tcl down people's throats?

OK, enough is enough.  I can see that I'm not going to be able to fool you
guys.  I confess everything.  You're right.  It all *was* an evil
conspiracy.  There really isn't a shred of merit in Tcl, or C++, or Perl,
or C; there is not a single reason on earth why anyone should use any of
these languages for any programming task.  Scheme truly is the perfect
language that solves every problem and combines the virtues of every
other language.  For years we've been plotting to trick programmers into
using bad languages.  Yes, I mean "we".  Many many people have participated
in this sinister plot, including Larry Wall, Dennis Ritchie, Bill Gates,
the Bureau of ATF, most of the LAPD, and Mark Fuhrman (sorry you guys, but
the truth has overwhelmed me so I've been forced to expose you).  I feel
just terrible at how I have set the programming world back, and I promise
to be a good boy from now on.

Now that that's over with, you can all get back to work now.


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

Date: 11 Apr 1997 09:34:43 -0500
From: madings@earth.execpc.com (Steve Mading)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5ili63$kad$1@earth.execpc.com>

Tim Behrendsen (tim@a-sis.com) wrote:

[ in response to the question, "What counts as hugely complex software?" ]

: Well, hard to measure these things of course, but let's say above the
: 100K-200K lines of code range.

: Perl4 is 33800 LOC (including comments, blank lines, etc), and Perl5
: is 51718.

A very good design requires less lines of code than a poor design to
do exactly the same thing.  Now if you want to argue that commercial
software is more likely to use stupid brute-force techniques, and
therefore will always have larger source code files, then I won't
argue :-)

Besides, "lines of code" is an absolutely horrible way to measure
source code.  Different indentation standards can as much as
double the number of lines of code in programs that are syntactically
exactly the same.  (Plus there's the issue of how much comments are
used.)

A slightly better count would be "words of code", using a program
like Unix's "wc" to count the words.  That way, extra blank lines 
and different indentation techniques would not affect the count.

The best way to count code would be to have something hooked into
the compiler so that the 'lex' part of the compiler could tell you
how many distinct 'tokens' were encountered.  This would be easy to
implement too, and has the added advantage of being able to ignore
the comments easily.


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

Date: 11 Apr 1997 14:15:02 GMT
From: "Tim Behrendsen" <tim@a-sis.com>
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <01bc4682$984235a0$87ee6fce@timpent.a-sis.com>

Peter Seebach <seebs@solutions.solon.com> wrote in article
<5ijs9t$f9h@solutions.solon.com>...
> In article <01bc45c0$691ee100$87ee6fce@timpent.a-sis.com>,
> Tim Behrendsen <tim@a-sis.com> wrote:
> >> What is the base line for "hugely complex" then?
> 
> >Well, hard to measure these things of course, but let's say above the
> >100K-200K lines of code range.
> 
> What, to be considered important a program has to be badly organized and
> involve a lot of duplication of existing work?

Do you think no program could ever be in that code range, and be
efficiently implemented?

> >Perl4 is 33800 LOC (including comments, blank lines, etc), and Perl5
> >is 51718.
> 
> Let's be fair; a LOC in C is worth a typical 3-5 LOC in assembly, certainly at
> least 3; likewise, a LOC of perl is worth at least 3-5 LOC in C, certainly at
> least 3, probably more like 8-10, because the basic operators are higher level
> and a lot of functionality (growing arrays, etc.) is silently handled....

Well, I meant "100K-200K" lines of C code.  I suppose there could be
some significant applications written in other languages, but that's
a small part of the question.

> How many lines of additional library support does perl5 include, which were
> written in perl?  Quite a few... and I bet they weigh in as at least 5 times
> their weight in equivalent functionality written in C.
>
> Hmm.  I show about 22kLOC of perl5 library support which is legitimately part
> of the language; I'd estimate that alone as roughly 100kLOC worth of C,
> probably more.

While I will grant that the Perl5 library support could be considered
part of the product, I think your formula is flawed.  If I implemented
them in C, then they would be linked with the Perl executable, and I
could call the Perl support routines directly.

-- 
==========================================================================
| Tim Behrendsen (tim@a-sis.com)        | http://www.cerfnet.com/~timb   |
| "Judge all, and be prepared to be judged by all."                      |
==========================================================================


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

Date: 11 Apr 1997 14:02:01 GMT
From: "Tim Behrendsen" <tim@a-sis.com>
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <01bc4680$d375c440$87ee6fce@timpent.a-sis.com>

Tom Wheeley <tomw@tsys.demon.co.uk> wrote in article <860708572snz@tsys.demon.co.uk>...
> tim@a-sis.com "Tim Behrendsen" writes:
> > Douglas Seay <seay@absyss.fr> wrote in article <334BC773.570E@absyss.fr>...
> > > What is the base line for "hugely complex" then?
> > 
> > Well, hard to measure these things of course, but let's say above the
> > 100K-200K lines of code range.
> > 
> > Perl4 is 33800 LOC (including comments, blank lines, etc), and Perl5
> > is 51718.
> 
> Therefore Perl is worse than Visual Basic because it's more elegantly
> designed?

I didn't say it was better or worse than anything.  It is a
marvelous, useful program.  It is simply a marvelous, useful
program that is not tremendously complex.  Or do you think any
program, of any complexity, can always be done in < 100,000 LOC?

The brilliance of Perl is the syntax and design, not the
implementation.  Perl4 and Perl5 are uncommented crap.  Quite
frankly, (no offense intended, Larry Wall -- I love Perl), I
would be embarrassed to release code without any comments.

> Virtually everything in Unix is designed to be small, because of the
> paradigm of a toolset of small programs which can be joined together.  Just
> because every Windows program has to do everything because of the basic
> unflexibility of the OS, doesn't mean that Windows programs are therefore
> better.

I never said that they were, and it's ridiculous to say "every
Windows program has to do everything" because you know it's not
true. Hyperbole adds nothing to your point.

In any case, the central question is whether it is possible to add
value to something such that a price can be set for it.  If a freeware
product is good enough that it's not worth adding value to it, then a
commercial version will never show up.

As a program gets more complex, the number of areas that are not
optimal or not implemented at all is going to naturally increase,
which is why the more complex the product, the higher the chances
that a commercial version is going to be better overall, simply
because of opportunity, greater resources and profit motive.

Programming tools is a special case within this, since programmers
often program them for themselves, so they're of the highest quality.
Free user-level applications, on the other hand, are usually far
inferior to commercial ones.

-- 
==========================================================================
| Tim Behrendsen (tim@a-sis.com)        | http://www.cerfnet.com/~timb   |
| "Judge all, and be prepared to be judged by all."                      |
==========================================================================


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

Date: 11 Apr 1997 14:04:06 GMT
From: "Tim Behrendsen" <tim@a-sis.com>
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <01bc4681$20d9c740$87ee6fce@timpent.a-sis.com>

Timothy Watson <tmwatson@umich.edu> wrote in article
<TMWATSON.97Apr10184314@lukyduk!.umich.edu>...
> In article <01bc45c0$691ee100$87ee6fce@timpent.a-sis.com> "Tim
> Behrendsen" <tim@a-sis.com> writes:
> > Perl4 is 33800 LOC (including comments, blank lines, etc), and Perl5
> > is 51718.
> 
> How about GRASS GIS (Geographical Information System) by the US Army
> Corp of Engineers? That's HUGE.

I don't think you can call software developed by US Army "free"
software, even if it's freely distributed, since the people who
developed it were paid to do it.

That's like IBM developing a big program, and then releasing the
source code.

-- 
==========================================================================
| Tim Behrendsen (tim@a-sis.com)        | http://www.cerfnet.com/~timb   |
| "Judge all, and be prepared to be judged by all."                      |
==========================================================================


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

Date: 11 Apr 1997 15:57:46 GMT
From: itz@rahul.net (Ian T Zimmerman)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <slrn5ksnrp.2t6.itz@kronstadt.rahul.net>

In article <E8DtLF.I9D@ukb.novell.com>,
Martin Sohnius x24031 <msohnius@novell.co.uk> writes:

>  Alicia Carla Longstreet (carla@ici.net) wrote: 

>>  Actually, exactly the opposite would be true.  Socialism has one
>> major flaw, a flaw that will forever make it never more than
>> marginally successful (unlike capitalism, which, over time is
>> always very successful).  Socialism fails to take into account the
>> simple fact that any human will work harder and smarter when he/she
>> directly enjoys the fruits of his/her labor.  Why should any person
>> work harder than needed to provide for him/herself when everything
>> beyond their needs goes to someone else.  Socialism assumes that
>> all people are willing to work for the social good.

>  And your definition of "successful" as applied to a social and
> political order ignores anything else but material gains.  Is it
> really the purpose of society to make everyone work harder?  Or
> rather to provide a worthwhile and happy life?

Exactly.  I agree completely with Martin, and see for example 

http://www.gnu.org/philosophy/motivation.html

But, folks, the newsgroup list needs work.  See followups...

-- 
Ian T Zimmerman                        <itz@rahul.net>
I fully support the President's proposal to test driver's license
applicants for drugs.  Any plan to reduce driving is worth a try.


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

Date: Fri, 11 Apr 1997 11:13:20 -0400
From: "M. Prasad" <prasadm@not4u.polaroid.com>
Subject: What's wrong with Lisp? (WAS:  Reply to Ousterhout's...)
Message-Id: <334E5510.244C@not4u.polaroid.com>

Steve Simmons wrote:
> 
> Lisp has suffered (as has UNIX) by being grossly oversold by it's
> proponents.  On close examination, the proponents of both have 

Yes, that's *exactly* the problem with Lisp -- the fanatics
who come with the language.  Many of them who are barely
competent to understand the concepts of Lisp but will go
to war for it.

By contrast, people using normal languages such as
C/C++ can be counted on to give levelheaded
opinions, because C/C++ are just tools.


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

Date: 11 Apr 1997 07:59:38 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: hennessy@cloud9.net (Mathew A. Hennessy)
Subject: Re: why can't arg 1 to shift be split?
Message-Id: <8cwwq9wqp1.fsf@gadget.cscaper.com>

>>>>> "Mathew" == Mathew A Hennessy <hennessy@cloud9.net> writes:

Mathew> I want to do this:
Mathew> 	require perl5;

Mathew> 	$user_name=shift( (split(/:/,$htpasswd_line)) );

Mathew> However, I get this in reply:

Mathew> Type of arg 1 to shift must be array (not split) at build-user_info.pl
Mathew> line 35, near ") )"
Mathew> Execution of build-user_info.pl aborted due to compilation errors.

Mathew> 	Now, what I am interested in knowing is if split returns a
Mathew> "second-class"  list of some kind..  Why can't I shift the list returned
Mathew> by split?  I'm not used to Perl telling me I _must_ do _anything_..

Operators that *act on* variables require variables as parameters, not
just values.  shift is one of these, along with push, pop, chomp, s///
and even "=" on the left side.  You can't "shift" a list value, any
more than you can set 5 to 3 with "5 = 3".

Fortunately, you don't need to do that, because:

	($user_name) = split /:/, $htpasswd_line;

works just fine.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 508 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

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 280
*************************************

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