[6706] in Perl-Users-Digest
Perl-Users Digest, Issue: 331 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 21 06:17:13 1997
Date: Mon, 21 Apr 97 03:01:52 -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 Mon, 21 Apr 1997 Volume: 8 Number: 331
Today's topics:
Re: Ousterhout and Tcl lost the plot with latest paper (Will Duquette)
Re: Ousterhout and Tcl lost the plot with latest paper <erik@naggum.no>
Re: Ousterhout and Tcl lost the plot with latest paper (Martin Cracauer)
Re: Pattern Substitution <rfi@uebemc.siemens.de>
Perl & Oracle <shecht@ibm.net>
Re: Perl & Oracle (John D Groenveld)
PERL file upload ?!?!? <w.vogel@student.kun.nl>
Perl Newsreader <calvin@ix.netcom.com>
Re: Prototypes and anonymous subs (Markus Laker)
random number in Perl <bpioline@thwgs2.cern.ch>
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Bart Schuller)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Hume Smith)
Re: Scripting vs. Systems (Rainer Joswig)
Setting value of environment variable QUERY_STRING <n1835173@sparrow.qut.edu.au>
Re: Sorting multidomensional array (Andrew M. Langmead)
variable-length database file I/O <sigrid@bconnex.net>
Re: Who will win? Borland or Microsoft or Programmers? <mbracey@interaccess.com>
Re: Who will win? Borland or Microsoft or Programmers? <mkotyk@profitsys.sk.ca>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 18 Apr 1997 11:32:58 -0700
From: will@peanut.jpl.nasa.gov (Will Duquette)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <wbybagw59h.fsf@peanut.jpl.nasa.gov>
In article <s6yn2qxkwix.fsf@aalh02.alcatel.com.au> Chris.Bitmead@alcatel.com.au (Chris Bitmead uid(x22068)) writes:
The only benefit you claim for Tcl that doesn't also apply to scheme
is #3. You would like to type...
func arg1 arg2
instead of
(func arg2 arg2)
Ok, a minor but perhaps valid point if you want dumb users to use it
like a shell.
And then, he goes on to suggest ways to make Scheme do that.
What I was expressing with my point #3 was a psychological effect, and
it extends to functions written in the language as well as individual
commands, though I notice it most when typing commands interactively.
I also prefer
if {$x < 3} {
foo arg1 arg2
} else {
bar arg3 arg4
}
to something like
(if (< x 3)
(foo arg1 arg2)
(bar arg3 arg4))
I confess, though I've toyed with Lisp and Scheme in the past, I'm
primarily a C programmer. Most of the people I work with are C
or C++ programmers. The Tcl version gives us warm fuzzies, and
the Scheme version doesn't.
I did a web search yesterday, and found a couple of Scheme
implementations which would probably work as well for my purposes as
Tcl, except for the psychological issues I mention. If I were
starting over, though, I'd still pick Tcl. It's plenty good enough,
and it "feels" better to me. Frankly, that's what's important.
--
--------------------------------------------------------------------------
Will Duquette, JPL | William.H.Duquette@jpl.nasa.gov
But I speak only | will@bean.jpl.nasa.gov
for myself. | It's amazing what you can do with the right tools.
------------------------------
Date: 19 Apr 1997 00:59:21 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <3070400361379585@naggum.no>
* James Logajan
| NOTE TO LISP AND FORTH FANS: one important reason your languages have
| never caught on may be due to the fact that many natural languages follow
| the "subject verb object" form. Usage of SOV, OSV, VSO, and VOS are less
| likely (I don't have any references in front of me; if anybody wants
| details, I'll try to locate what I have). They also lack visual
| redundancy (they aren't alone in this short-coming of course).
I hope you find studies of human factors with _experienced_ users. the
results coming from the ever-present inexperienced users has no validity
for more than inexperienced users, yet get touted as truths about the
languages. this tends to annoy people who believe that "experience" is a
valid concept in any discipline.
for some reason, we don't see open heart surgery defamed by "research" into
how inexperienced users with a scalpel and an attitude kill people and that
it should therefore be a discommended practice.
many a Lisp programmer will testify that he thinks in Lisp and reads Lisp
code with _less_ "stack depth" and "cognitive load" than is needed for the
many other languages he knows. e.g., I find C to be _much_ harder to read
than Lisp because I need to scan forward in hairy expressions a lot to know
how things work together, and to scan backwards for type information. I
also have to work to remember operator precedence rules in the language.
in Lisp, I may have to scan back and upwards, but I've already been there
when I'm reading the code. in C++, I need to keep in mind the classes of
all the variables so I can have a glimmer of hope of understanding _which_
function is being called. the foo in x.foo is not the foo in y.foo, unless
the class of x and the class of y relate such that they are. in CLOS, (foo
x) and (foo y) is the same generic function with different specializers and
a Lisp programmer is _much_ less likely to implement widely different
semantics with the same name than is a C++ programmer who is "alone" in his
class (hierarchy).
there should be a measure of "mental clutter" that each language leaves
with its (moderate to excellent) programmers.
somebody should tell those Subject-Verb-Object guys from the wrong
department that it is quite uncommon to nest sentences and expressions the
way it is done in programming languages, lest this invalid argument should
keep coming back from the argument grave yard yet again. for some reason,
C/C++ programmers can't handle very deep nesting, while Lisp people can.
my take on this is that C/C++ already "use up" quite a number of "stack
levels" with its complex syntax, while Lisp does not, and can use those
"stack levels" for real work.
back in high school, I was reprimanded by my teachers for using too long
sentences and too complex sentence structure. (my editors have said the
same.) I found the rules they laid down for me to follow to be extremely
crippling in expressive power. write short sentences. use only simple
conjunctions. don't use the passive voice. the active voice helps
"involve" people. this all gives me the creeps. subject verb object. I
just don't think that way. I think of my sentences as evaluation of nested
expressions that yield intermediate values used by other parts of the
sentence and which conclude in communicating some meaning. the paragraph
is similarly constructed to carry those sentence-values forward into a
concluding sentence. this process _precludes_ the use of stunted forms and
the imperative, active style for me. then again, I don't write children's
books or "Crotch Sniffing for Dummies".
and last time I checked, I was still human, despite all this bogus research
into human factors that pretends I and people like me don't exist.
#\Erik
--
I'm no longer young enough to know everything.
------------------------------
Date: Fri, 18 Apr 97 10:05:42 GMT
From: cracauer@wavehh.hanse.de (Martin Cracauer)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <1997Apr18.100542.10768@wavehh.hanse.de>
danh@danpc.cris.com (Dan Haskell) writes:
>In article <5ilbk6$f85$2@news.du.etx.ericsson.se>, Robert Virding wrote:
>[lots snipped]
>>A final question which has long interested me and which seems relevant
>>to this whole discussion: who would use Tcl if it DIDN'T have such a
>>integrated interface to Tk?
>Anyone who wanted a simple scripting language that could be easily embedded
>into their applications. Last time I checked Tcl was the only language you
>could do this with. There was something called libscheme that came close,
>but did not really allow for full integration with the application.
What do you mean by "full integration with the application"? Libscheme
just lets you control the Scheme interpreter from C, what does Tcl has
that helps your integration.
Talking of Scheme's for embedding:
mzscheme is built on top of libscheme and somewhat more under
developement. Uses the same C call interface (and a slightly screwup
up install procedure). Mzscheme also has support for Guile's C
interface.
SCM and Guile are another line, using a different interface (two, to
be precises), a faster interpreter than libscheme that is slower at
startup.
The third is Elk, which focuses on using C from Lisp, can load object
files at runtime. The other systems work the other way round, by
linking the C program with a scheme lib.
Elk is very descent, libscheme as well, but guile-1.0 lacked suport
for important functions when it comes to embedding (the current
snapshots have them) and Scm is somewhat hard to build for
non-experienced people.
Martin
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin_Cracauer@wavehh.hanse.de http://cracauer.cons.org Fax.: +4940 5228536
"As far as I'm concerned, if something is so complicated that you can't ex-
plain it in 10 seconds, then it's probably not worth knowing anyway"- Calvin
------------------------------
Date: 21 Apr 1997 11:13:01 +0200
From: Ronald Fischer <rfi@uebemc.siemens.de>
To: THIAM YEO <n1835173@sparrow.qut.edu.au>
Subject: Re: Pattern Substitution
Message-Id: <xz2k9lweo2q.fsf@uebemc.siemens.de>
>>>>> On Sun, 20 Apr 1997 14:47:09 +1000
>>>>> "THIAM" == THIAM YEO <n1835173@sparrow.qut.edu.au> wrote:
THIAM> a:b:c:def
THIAM>
THIAM> How do I substitue def with a whitespace from within a PERL program?
s/:def$/:/
--
Ronald Otto Valentin Fischer (PGP public key available on request)
business: ronald.fischer@uebemc.siemens.de
private: ronald.fischer@acm.org
http://ourworld.compuserve.com/homepages/ronald_fischer/
------------------------------
Date: Sat, 19 Apr 1997 15:20:34 +0300
From: Dan Shechter <shecht@ibm.net>
Subject: Perl & Oracle
Message-Id: <3358B892.7B2898B9@ibm.net>
Hi,
I'm a semi experienced perl programmer, And I'm hopelessly trying
to make perl work with Oracle.
Can anyone bring me up to the full story about perl & oracle?
Where, How, and Why?
Thanks, Dan
------------------------------
Date: 20 Apr 1997 14:31:26 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Perl & Oracle
Message-Id: <5jdndu$aci$1@tholian.cse.psu.edu>
In article <3358B892.7B2898B9@ibm.net>, Dan Shechter <shecht@ibm.net> wrote:
>Can anyone bring me up to the full story about perl & oracle?
The complete story is in the spring issue of the Perl Journal,
http://www.tpj.com/, which may be at a newstand near you. Also take a look at
http://www.hermetica.com/technologia/DBI/ and the archive of this newsgroup
at http://www.dejanew.com/
Happy perl'ng,
John
groenvel@cse.psu.edu
------------------------------
Date: Sat, 19 Apr 1997 12:11:17 +0200
From: "w.vogel" <w.vogel@student.kun.nl>
Subject: PERL file upload ?!?!?
Message-Id: <33589A45.3C1B@student.kun.nl>
Hi there!
I am tying to allow my visitors to upload pics
to my site. Now i already know I have to use a
form with enctype=multipart/form-data and method
is POST, but the entered filename does not transfer
anything into my $in{'file'}....
I am doing something very wrong. But what?
Who can help me on this?
Wouter Vogel,
w.vogel@student.kun.nl
------------------------------
Date: 19 Apr 1997 00:29:05 GMT
From: "netuser" <calvin@ix.netcom.com>
Subject: Perl Newsreader
Message-Id: <01bc4c58$99f90c80$a1995ccf@default>
I have been trying to find a script for Win '95 Perl to connect and read in
newsgroups to a buffer or text file?
Any ideas, or is there one already written.
------------------------------
Date: Sat, 19 Apr 1997 15:53:33 GMT
From: laker@tcp.co.uk (Markus Laker)
Subject: Re: Prototypes and anonymous subs
Message-Id: <3358d9a4.20480038@news.tcp.co.uk>
dblack@icarus.shu.edu (David Alan Black):
> I can't duplicate your error, with Perl5.003_95:
Thanks for the reassurance. It's good to know that the bug is known
about and a fix will eventually percolate through to the Win32 world.
Unfortunately, Perl5.003_95 isn't yet available on that platform, so
I'll have to work around the problem.
Markus Laker.
--
If you quote me, I would appreciate an email copy of your article.
------------------------------
Date: Sun, 20 Apr 1997 17:47:02 GMT
From: Boris Pioline <bpioline@thwgs2.cern.ch>
Subject: random number in Perl
Message-Id: <335A5696.41F8@thwgs2.cern.ch>
Hi there,
can anybody tell me how to generate random integers in Perl ?
I just need one every time my program runs, so I was thinking of using CPU time
modulo some number, but I don't know how to access CPU time !
Thanks for help
Boris P.
PS: Please reply to Boris.Pioline@cern.ch, as I don't read
this newsgroup too often.
------------------------------
Date: 20 Apr 1997 16:38:30 GMT
From: schuller+news@lunatech.com (Bart Schuller)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5jdgq6$f6q$1@aladdin.rotterdam.luna.net>
In article <E8FMn4.5u8@undergrad.math.uwaterloo.ca>,
Paul Prescod <papresco@csclub.uwaterloo.ca> wrote:
>Have you considered allowing the user to choose his or her own extension
>language? I am really tired of products forcing Basic or some other terrible
>thing down my throat. Under Windows you can use OLE Automation to keep your
>product open to multiple scripting languages. Under other platforms you can
>use the JVM as your "scripting language" and any language that can be
>compiled to byte codes can be the scripting language. There are dozens of
>languages that fit that criteria now, and the list is growing every day.
You don't even have to use the JVM, you know. CORBA can be used to make
your objects available for scripting. 700 companies back CORBA. It's
standardized, there are free implementations in many languages. And if
your favourite language doesn't have a CORBA binding, you write one.
Which in my case (Perl) is a lot easier than having the language run on
a JVM :-)
--
Bart Schuller schuller+sig@lunatech.com At Lunalabs, where the
Lunatech Research http://www.lunatech.com/ future is made today..
Partner of The Perl Institute http://www.perl.org/ Linux http://www.li.org/
------------------------------
Date: 19 Apr 1997 23:15:29 GMT
From: hclsmith@tallships.istar.ca (Hume Smith)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5jbjmh$6ns@news.istar.ca>
In article <33588b2c.1887203@news.demon.co.uk>, alaric@abwillms.demon.co.uk
says...
>Actually, I think they'd prefer audio samples instead of either...
>
>"Let X equal Y plus one, write X to the screen, then for every element
>E of list B, write E to the screen, end loop."
"let tex eke wall why plus won, rye text to the scream, then forever elephanty
of list bee, rye tea tooth ask ream, end loupe." rightho, me ol' bucko! :)
------------------------------
Date: Sun, 20 Apr 1997 08:35:04 +0200
From: joswig@lavielle.com (Rainer Joswig)
Subject: Re: Scripting vs. Systems
Message-Id: <joswig-ya023180002004970835040001@news.lavielle.com>
In article <r8twwq0fkq5.fsf@dynamic.CS.Princeton.EDU>,
danwang@dynamic.CS.Princeton.EDU (Daniel Wang) wrote:
> But it doesn't provide any special builtin pre-packaged support for
> manipulating a specific set of abstractions. (Special syntax for example)
Symbolics Common Lisp with Genera does provide this.
It has a command interpreter substrate, infix parser, ...
> objects a type system isn't worth it. This is why Lisp doesn't have a type
> system, even though I think it could really use it.
Huh? Common Lisp has a type system. For quite a long time.
The CMU CL compiler takes advantage of this using type inference
for both optimization and type checking.
--
http://www.lavielle.com/~joswig/
------------------------------
Date: Sat, 19 Apr 1997 14:50:16 +1000
From: THIAM YEO <n1835173@sparrow.qut.edu.au>
Subject: Setting value of environment variable QUERY_STRING
Message-Id: <Pine.OSF.3.93.970419144515.10730A-100000@sparrow.qut.edu.au>
Hi there!
IS it possible for me to set the value of QUERY_STRING from a Perl
script such that another script will be able to pick up that value?
And, how do I pass a value from a Perl script to another Perl script?
Thanks in advance for any help.
Best Regards,
==================================================================
Ervin Yeo Thiam Soon
Internet : ervinyeo@elf.brisnet.org.au
Fidonet : 6:600/237.0
------------------------------
Date: Sun, 20 Apr 1997 17:20:58 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Sorting multidomensional array
Message-Id: <E8y5Iy.yK@world.std.com>
"Timothy H. Heaton" <theaton@sunflowr.usd.edu> writes:
>I'm having trouble getting a multidimensional array to sort. For the
>following array I've tried the two sorts below and neither does anything.
> @array = ( [ "c", "z", 3 ], [ "a", "x", 1 ], [ "b", "y", 2] );
> @array = sort { lc($array[$a][0]) cmp lc($array[$b][0]) } @array;
> @array = sort { $a[2] <=> $b[2] } @array;
First start with what @array contains. It contains a list of
references to arrays. These arrays have a similar structure to each
other because each contain three scalars, the first two that the user
and programmer will probably want to be sorted in dictionary order,
and the third which they will want to be sorted numerically.
So as you sort @array, $a and $b will each be aliased to the elements
of @array, which are references. To dereference these scalars and
access the elements they point to use $$a[0] or $a->[0].
Which gives you:
@array = sort { $a->[2] <=> $b->[2] } @array;
or
# the original elements base on the result of
@sorted = map { $_->[0] }
sort { $a->[1] cmp $b->[1] } # comparing a list consisting of
# the lc()'d version of the 1st elem pointed to by the elems of @array
map { [ $_, lc $_->[0] ] } @array;
--
Andrew Langmead
------------------------------
Date: Sat, 19 Apr 1997 11:26:08 -0400
From: SiGRiD <sigrid@bconnex.net>
Subject: variable-length database file I/O
Message-Id: <3358E410.442D@bconnex.net>
HIHOWARYA!
I`m looking for any and all input here; if you think you know something
that might help, please email me and let me know.
My situation is this: I'm writing some file i/o routines for a
database. Each entry is comprised of a number of variable-length
delimited fields, and each line in the data file contains one entry.
(In effect, the data file is a number of fields delimited by \n.) The
problem I have run into is trying to update an entry's information.
Because the entries are variable-length, if the update happens to be
longer than the previous entry in the file, using syswrite() will
overwrite part of the next entry.
Obviously the simplest solution would be to make the entries
fixed-length, but for various reasons I would really rather avoid that.
Any ideas on how I can make the updates without losing data behind it?
Any and all suggestions welcomed. Please CC: replies to
greg@bconnex.net.
Greg Boyington
Barrie Connex Technical Support
http://www.bconnex.net/
greg@bconnex.net
------------------------------
Date: Sun, 20 Apr 1997 11:15:29 -0500
From: Mark Bracey <mbracey@interaccess.com>
Subject: Re: Who will win? Borland or Microsoft or Programmers?
Message-Id: <335A4121.4FFE@interaccess.com>
hbaecker@island.net wrote:
> Borland Delphi 2 is incredibly difficult to use.
You are kidding...right?
------------------------------
Date: 18 Apr 1997 19:50:09 GMT
From: "Mark Kotyk" <mkotyk@profitsys.sk.ca>
Subject: Re: Who will win? Borland or Microsoft or Programmers?
Message-Id: <01bc4c31$f44c97a0$ac84a9c6@profit5.profitsys.sk.ca>
> >Hi,
> > My company is planning to start a project. We have a big
question
> >about our investments. We don't know if we should use Microsoft
> >compiler or Borland.
>
> Use neither!
>
> IBM's VisualAge C++ is a cross-platform compiler, allowing you to move
your
> code to OS/2, Win95, WinNT and AIX when Borland, Microsoft or both chokes
> on Java. It comes with a pretty impressive set of tools too.
>
> (IBM does a VisualAge Java too - out any day now ;-)
<cut>
I bet you run OS/2 :\
Use MS! I've found that Borland sometimes comes short. Example:
Win32, Borland 4.52 - No inp or outp! Oooops... No I/O - Did we forget
something? Ahhh well, just buy our 32bit Assembler ...
------------------------------
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 331
*************************************