[6695] in Perl-Users-Digest
Perl-Users Digest, Issue: 320 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 17 01:07:25 1997
Date: Wed, 16 Apr 97 22: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: 320
Today's topics:
Re: "Dummies" book any good? (Jon Bell)
Re: An extended e-mail parser (Geoffrey Hebert)
Can't compile perl 5.003 on slackware 1.2.13 <joeallen@gizmo.usc.edu>
CGI Prog words, but not all the time <mwilson@csd.uwm.edu>
Re: CGI Prog words, but not all the time (Ivar Lade)
Re: Code without comments (Was: Re: Unix and ease of us (Tom Wheeley)
Creating a table <puttkammer@access.ch>
flock and dbm files <gsarlas@foobar.res-hall.nwu.edu>
Re: Input Loop Consumes Resources (Ilya Zakharevich)
Re: Inseting into a specific part of text.. (Tad McClellan)
Module for connecting to NT performance API?? <david_mitchell@hp.com>
Re: Newbie Question: regexp email address.. <merlyn@stonehenge.com>
Re: Number of Array Elements (rga)
Re: Ousterhout and Tcl lost the plot with latest paper <graham.matthews@maths.anu.edu.au>
Re: Ousterhout and Tcl lost the plot with latest paper (George Herbert)
perl syntax error <syed.babar@amd.com>
Printing X amount of lines from begining/middle of file (Adam Levy)
Re: Printing X amount of lines from begining/middle of (Tad McClellan)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (George Herbert)
sed? <kin@isi.com>
Re: sed? <tchrist@mox.perl.com>
Re: sed? (Tad McClellan)
Two-Way Sockets in Perl <jmpirie@java.acs.ucalgary.ca>
Re: Unix and ease of use (WAS: Who makes more ...) <tim@a-sis.com>
Re: Unix and ease of use (WAS: Who makes more ...) (Ell)
Re: Unix and ease of use (WAS: Who makes more ...) (Janus)
Re: Wanted: UNIX email parser <eryq@enteract.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 17 Apr 1997 03:10:52 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: "Dummies" book any good?
Message-Id: <E8rI64.D0p@presby.edu>
Russ Allbery <rra@stanford.edu> wrote:
>A final note on this: If someone's an absolute rank beginner at
>programming, unless they have an intuitive feel for structured design and
>immediately grasp the concept of an if/then/else block the first time it's
>explained to them (you'd be surprised at the number of people who don't),
Not to mention the people who are slow to grasp the idea of sequential
execution of statements/instructions. Halfway through last semester
I was *still* reminding one of my CS1 (C++) students, "you gotta print
out your prompt *before* you try to read in that variable" (or something
equally "obvious").
>I'd strongly recommend they find a local community college and take their
>basic programming course rather than try to learn from a book. It'll be a
>lot less frustrating and a lot more productive, and probably make them a
>better programmer in the long run.
Or at least have a friend on call who knows programming and can sit
down with you every once in a while and walk through your code with you.
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]
------------------------------
Date: Thu, 17 Apr 1997 03:05:30 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: An extended e-mail parser
Message-Id: <5j431d$4eq$3@news3.microserve.net>
Try -
MHonArc v2.0 beta 3 is available. Beta 3 fixes bugs that
have been reported against v2.0 beta 2.
See (http://www.oac.uci.edu/indiv/ehood/mhonarc.html) for
download instructions and more information.
Peter Jastreboff <jast@ms.com> wrote:
>Hi,
> I am trying to write an e-mail parser which will take emails sent to
>an predefined id and do the following.
>1. separate and sort the subject information.
>2. take the main message body and post it in an HTML file.
>3. Allow differnt parameters to sort the Subject information.
>I have a good handle on how to Subject informatin, however, I am having
>trouble parsing out the message body and then sending it to and HTML
>file. Any ideas or example scripts I could follow?
> Thanks,
> Hut
Check out the Perl site!
http://www.microserve.net/~soccer/
use password perlmisc
Geat tool for Developers>
------------------------------
Date: Wed, 16 Apr 1997 20:50:38 -0700
From: Joe Allen <joeallen@gizmo.usc.edu>
Subject: Can't compile perl 5.003 on slackware 1.2.13
Message-Id: <33559E0E.1E4F2356@gizmo.usc.edu>
Hi.
I'm trying to build 5.0003 on a pentium pro running Linux slackware
1.2.13.
I'm trying to upgrade from perl 5.001 to 5.003, so that I can use GD.pm
Problem: make is breaking on the SDBM_FILE section.
Relevant output from the make appears below.
I'm using the "latest.tar.gz".
I've read the INSTALL notes, the hints/linux.sh, the FAQS and tried
dejanews.
Is there anything strange about the slackware file hierarchy such that
perl 5.003 wouldn't build properly?
I've tried a bunch of variants on the configure script.
There is mention of Malloc problems in INSTALL,
but I don't think that's my problem. I've tried both
suggestions concerning -D flags anyway.
"make minitest" is successful.
Any hint about why the make would break here is appreciated.
Thanks for your time.
If this is the wrong group correct pointer would be appreciated.
Here is the relevant output:
sdbm.c:39: parse error before `malloc'
sdbm.c:39: warning: parameter names (without types) in function
declaration
sdbm.c:39: warning: data definition has no type or storage class
sdbm.c:40: parse error before `free'
sdbm.c:40: warning: parameter names (without types) in function
declaration
sdbm.c:40: warning: data definition has no type or storage class
sdbm.c:41: parse error before `lseek'
sdbm.c:41: warning: data definition has no type or storage class
sdbm.c: In function `sdbm_open':
sdbm.c:93: warning: assignment makes pointer from integer without a cast
sdbm.c: In function `sdbm_prep':
sdbm.c:129: `O_WRONLY' undeclared (first use this function)
sdbm.c:129: (Each undeclared identifier is reported only once
sdbm.c:129: for each function it appears in.)
sdbm.c:130: `O_RDWR' undeclared (first use this function)
sdbm.c:132: `O_RDONLY' undeclared (first use this function)
make[2]: *** [sdbm.o] Error 1
make[2]: Leaving directory
`/usr/users/joeallen/perl5.003/ext/SDBM_File/sdbm'
make[1]: *** [sdbm/libsdbm.a] Error 2
make[1]: Leaving directory `/usr/users/joeallen/perl5.003/ext/SDBM_File'
make: *** [lib/auto/SDBM_File/SDBM_File.so] Error 2
-Joe Allen
------------------------------
Date: 17 Apr 1997 01:11:49 GMT
From: "Michael Wilson" <mwilson@csd.uwm.edu>
Subject: CGI Prog words, but not all the time
Message-Id: <01bc4acc$c71a3aa0$010200c0@tia.csd.uwm.edu>
Two CGI program at my web site work, but they
only work intermittently. Sometimes you have to
re-fresh the page 4 or 5 times before the CGI program
finally runs.
When it was happening with my search program, I
thought it was the software. But I installed a guestbook
program, and it also works intermittently.
When it doesn't work, the returned box says: "Internet
Explorer cannot open the Internet Site. . . . The operation
completed successfully." When Netscape doesn't work,
it returns saying the page is empty, as I recall.
One of the web sites is:
http://www.uwm.edu/~mwilson/nativelit/2
try the search engine.
Thanks for any suggestions.
Mike
------------------------------
Date: 17 Apr 1997 01:57:04 GMT
From: il@litago.hials.no (Ivar Lade)
Subject: Re: CGI Prog words, but not all the time
Message-Id: <slrn5lb0sh.kml.il@litago.hials.no>
17 Apr 1997 01:11:49 GMT, Michael Wilson <mwilson@csd.uwm.edu>:
>
>Thanks for any suggestions.
>
>Mike
web-server's error_log might help you ...
--
Ivar Lade
http://3data.hials.no/~il/
------------------------------
Date: Thu, 17 Apr 97 01:18:11 GMT
From: tomw@tsys.demon.co.uk (Tom Wheeley)
Subject: Re: Code without comments (Was: Re: Unix and ease of use (WAS: Who makes more ...))
Message-Id: <861239891snz@tsys.demon.co.uk>
In article <5j2m1k$ngf@access5.digex.net>
cobrien@access5.digex.net "Cary B. O'Brien" writes:
> no comments other than this one - comments being an indication that
> code is too complex to be trusted.
Rubbish.
Never comment the code, comment the process.
--
:sb)
------------------------------
Date: Wed, 16 Apr 1997 21:22:43 +0200
From: Andreas Puttkammer <puttkammer@access.ch>
Subject: Creating a table
Message-Id: <33552703.6F41@access.ch>
Hello,
with which kind of variable can i create a table with diffrent values.
as much as i know (which isn't really much) i can't do it whith an
array, because the values are in a particular order.
i need to create a table with different values which are extracted from
different files.
So the table should look like this:
Server1 Server2 Server3 ...
Memory 256 256 192
Disks 20GB 18GB 32GB
Package1 Ver2 Ver2.1 Ver2
Package2 Ver1.5 Ver1.5 Ver1.5b
Package3
and so on..
Can somebody give me a hint, how to create such a table. But you have to
know that the values are written one by one (First Server1, then i
extract the second file and write Server2 and so on....).
I'll appreciate any suggestions.
Many thanks in advance
Andrew (Perl beginner)
-----------------------------------------------------------------
Andreas Puttkammer
Langstrasse 229
CH - 8005 Z|rich
Tel: ++41 (0)1 273 24 73
mailto: puttkammer@access.ch
------------------------------
Date: Wed, 16 Apr 1997 20:42:01 -0500
From: George Sarlas <gsarlas@foobar.res-hall.nwu.edu>
Subject: flock and dbm files
Message-Id: <Pine.LNX.3.95.970416203838.3187A-100000@foobar.res-hall.nwu.edu>
I am writing some cgi scripts in perl where multiple users will need to
access and change information in the same dbm file at the same time. When
you use "dbmopen", does that lock out other processed from the file named
until a "dbmclose" is done? Or do you need to use something like "flock"
to create a file lock? And if you do need to use "flock", it requires the
fild descriptor. How can you obtain that from a "dbmopen" if there is no
file handle? Any help would be much appreciated. If you could email me
directly, that would be great too. :)
George Sarlas
gsarlas@foobar.res-hall.nwu.edu
------------------------------
Date: 17 Apr 1997 01:27:01 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Input Loop Consumes Resources
Message-Id: <5j3u95$hic$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Matt Garretson
<garrem@rpi.edu>],
who wrote in article <5j3598$1scm@alumni.rpi.edu>:
> I have the following script:
>
> #!/usr/local/bin/perl5.003_93 -w
> while (<>) {
> /\.SO (.{0,15})/o && print "$1\n";
> }
>
> When a ~110 MB input file is piped into the above, the process grows in
> size until it has consumed the system's free page space (~175 MB) and
> then aborts with the "Out of memory!" message. No output is produced,
> although there are matching lines very early in the input file. The
> input file consists of 4096-byte lines of text. The OS is AIX 3.2.5
> with a 200 MB page space on an RS/6000 with 128 MB physical memory.
>
> I tried the above script with perl 5.001 and it also failed in the
> same manner, but well before the paging space had been exhausted.
Without a possibility to reproduce this do not expect to get any
help. I tried running the script
./perl -wne '/\.SO (.{0,15})/o && print "$1\n"'
over pp_hot.c and over
pp_hot.c pp_hot.c pp_hot.c pp_hot.c pp_hot.c pp_hot.c
and the difference in memory usage was 24 bytes.
Ilya
monk:~/perl/perl5.003_93->env PERL_DEBUG_MSTATS=2 ./perl -wne '/\.SO (.{0,15})/o && print "$1\n"' pp_hot.c
Memory allocation statistics after compilation: (buckets 4(4)..8184(8192)
25236 free: 160 71 46 25 10 3 0 2 1 0 1
327 96 30 21 17
36032 used: 64 49 78 37 6 5 4 10 0 0 1
57 53 130 61 8
Total sbrk(): 64264/ 11. Odd ends: pad+heads+chain+tail: 776+2220+0+0.
Memory allocation statistics after execution: (buckets 4(4)..16376(16384)
41324 free: 158 70 46 24 9 3 0 2 1 0 1 1
327 96 29 20 17
52696 used: 66 50 78 38 7 5 4 10 0 0 1 1
57 53 131 62 8
Total sbrk(): 97032/ 13. Odd ends: pad+heads+chain+tail: 776+2236+0+0.
monk:~/perl/perl5.003_93->env PERL_DEBUG_MSTATS=2 ./perl -wne '/\.SO (.{0,15})/o && print "$1\n"' pp_hot.c pp_hot.c pp_hot.c pp_hot.c pp_hot.c pp_hot.c pp_hot.c pp_hot.c
Memory allocation statistics after compilation: (buckets 4(4)..8184(8192)
25128 free: 160 71 46 25 10 3 0 2 1 0 1
327 89 31 20 17
36140 used: 64 49 78 37 6 5 4 10 0 0 1
57 60 129 62 8
Total sbrk(): 64264/ 11. Odd ends: pad+heads+chain+tail: 776+2220+0+0.
Memory allocation statistics after execution: (buckets 4(4)..16376(16384)
41300 free: 158 70 46 24 9 3 0 2 1 0 1 1
327 96 30 19 17
52720 used: 66 50 78 38 7 5 4 10 0 0 1 1
57 53 130 63 8
Total sbrk(): 97032/ 13. Odd ends: pad+heads+chain+tail: 776+2236+0+0.
------------------------------
Date: Wed, 16 Apr 1997 20:32:12 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Inseting into a specific part of text..
Message-Id: <siu3j5.0l.ln@localhost>
Mark C Seigle (mianzo+@cs.cmu.edu) wrote:
: Hello, I am kind of new to some Perl functions. I was wondering if
: someone could point me to a way of...
^^^^^^^^^^^^^^^^^^^^
The Perl FAQ can. From part 5:
"How do I change one line in a file/delete a line in a file/insert a line
in the middle of a file/append to the beginning of a file?"
Get the FAQ. Read the FAQ. Search the FAQ. The FAQ is your friend...
: grepping for a line of text in an ascii file...
^^^^
while (<>) {print if /your_regex_here/} # the line number is in $. variable
: inserting at that line number....
: I am firmilliar with standard file operations, however I cannot figure
: out how to throw something into the middle of the text.
^^^^^^
grep middle faq.* find one line. The one above!
(actually I first did 'grep file faq.*', over 200 matches. Too much.
So then I fell back to searching only the POD tagged lines:
grep '^=' faq.* |grep file
that found only 40 lines. The question above was the sixth one.
Applying some resourcefulness to word searching in the PODs and
FAQs is nearly always worth the time...
)
: All help is greatly appreciated!
Uh huh.
All checking of freely available resources before posting is
greatly appreciated! ;-)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 17 Apr 1997 14:16:36 +1000
From: "Dave Mitchell" <david_mitchell@hp.com>
Subject: Module for connecting to NT performance API??
Message-Id: <5j44p2$is31@hpcc883.corp.hp.com>
Has anyone written any modules to reference NT's performance API? I want
to do some baselining monitoring of NT systems referencing stuff available
under this API, and I figure someone must have already done this...I
hope...maybe...
Regards
Dave Mitchell
------------------------------
Date: 16 Apr 1997 20:14:37 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Ronald Fischer <rfi@uebemc.siemens.de>
Subject: Re: Newbie Question: regexp email address..
Message-Id: <8civ1mcpcy.fsf@gadget.cscaper.com>
>>>>> "Ronald" == Ronald Fischer <rfi@uebemc.siemens.de> writes:
Ronald> $name=q,[a-zA-Z:_.0-9"$!%]+,; # set of characters that can be part of
Ronald> # a name in an email address
Ouch. No. Here we go again.
This is wrong.
fred&barney@stonehenge.com is a legal email address (try it!).
Nearly any character is valid on the left of the @.
[Doesn't anyone use Dejanews any more? :-(]
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 502 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: Thu, 17 Apr 1997 04:07:45 GMT
From: rga@io.com (rga)
Subject: Re: Number of Array Elements
Message-Id: <3355a161.16096160@news.io.com>
geecee@burbot.netquarters.net (Gary Chambers) wrote:
>I'm trying to determine the number of elements in an array. Is it
>correct to use:
>
>$elements = @array;
Perl is not mixed up with what you are asking here.
It assigns the Number of elements in @array to
your scalar EVERYTIME !
------------------------------
Date: Thu, 17 Apr 1997 12:07:29 +1000
From: Graham Matthews <graham.matthews@maths.anu.edu.au>
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <335585E1.34E7@maths.anu.edu.au>
Will Duquette wrote:
> You'll notice that I've made no arguments about Tcl as a *language*.
> Pragmatically speaking, though, it enables me to get my job done
> easily, efficiently, and well.
At last a sensible attitude about Tcl. No unjustified claims to
superiority, just pragmattics.
graham
--
You can blow out a candle
But you can't blow out a fire
Once the flame begins to catch
The wind will blow it higher
------------------------------
Date: 16 Apr 1997 19:38:26 -0700
From: gherbert@crl.com (George Herbert)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5j42f2$p8s@crl3.crl.com>
Note followups.
Dan Haskell <danh@danpc.cris.com> wrote:
>>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.
One example, the one that got me started using Tcl, is the ICB chat
program (formerly fn). The origional author embedded Tcl 3.0 in one
version to allow for users setting up macros and customizing things
and it's been there ever since (though it got upgraded to newer
versions of Tcl over time). It's completely text based and Tk
has never entered the picture.
Embedding in a easily customizable interpreted language has all sorts
of nifty applications if you think about it.
-george william herbert
gherbert@crl.com
------------------------------
Date: Wed, 16 Apr 1997 19:45:25 -0700
From: Syed Babar <syed.babar@amd.com>
Subject: perl syntax error
Message-Id: <33558EC5.1E8F@amd.com>
Can any one tell me what is wrong in this :
$ex =`rsh $i 'if ( -e "/etc/lsf.conf") echo 1'` ;
if(!$ex) {
when i run it i get error:
"sh: syntax error at line 1: `echo' unexpected"
the "line 1" can be ignored.
--------------------------------------------------------------------+
|Syed Babar
---------------------------------------------------------------------+
------------------------------
Date: Wed, 16 Apr 1997 21:31:35 -0500
From: adrade@wwa.com (Adam Levy)
Subject: Printing X amount of lines from begining/middle of file. How?
Message-Id: <adrade-1604972131360001@pool3-002.wwa.com>
Is it possible to, from a file, print the first 15 lines from the file,
and in another case, print lines 15-30, etc. in seperate instances? Any
help is greatly appreciated. If possible, email responses are also
appreciated.
Thanks,
-Adam Levy
------------------------------
Date: Wed, 16 Apr 1997 22:18:08 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Printing X amount of lines from begining/middle of file. How?
Message-Id: <gp44j5.slb.ln@localhost>
Adam Levy (adrade@wwa.com) wrote:
: Is it possible to, from a file, print the first 15 lines from the file,
perl -ne 'print; exit if $. == 15' filename
: and in another case, print lines 15-30, etc. in seperate instances? Any
------------
#! /usr/bin/perl -w
# print_some
$start=shift;
$end=shift;
while (<>) {
print if $. >= $start;
last if $. == $end;
}
------------
invoke it thus:
print_some 15 30 filename
: help is greatly appreciated. If possible, email responses are also
: appreciated.
search for 'line number' in the perlvar man page...
: Thanks,
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 16 Apr 1997 19:32:25 -0700
From: gherbert@crl.com (George Herbert)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5j423p$p66@crl3.crl.com>
Tom Christiansen <tchrist@mox.perl.com> wrote:
>:OTOH, for the penultimate extension of LISP, look at Common LISP and
>:Emacs!
>Since when does penultimate mean anthing other that second-to-last?
The last extension of Lisp will be the Emacs OS, of course, where the
editor ceases to be just the shell and also becomes the underlying kernel...
-george william herbert
gherbert@crl.com
------------------------------
Date: 16 Apr 1997 19:35:37 -0700
From: Kin Cho <kin@isi.com>
Subject: sed?
Message-Id: <uvi5mfkau.fsf@isi.com>
Is there a sed() function that parallels sed,
just like grep() parallels grep?
I think I've looked, but just in case...
Also, if not, why?
-kin
------------------------------
Date: 17 Apr 1997 03:27:10 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: sed?
Message-Id: <5j45ae$l69$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Kin Cho <kin@isi.com> writes:
:Is there a sed() function that parallels sed,
:just like grep() parallels grep?
The grep() function doesn't work like the grep function,
you know.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
It is, of course, written in Perl. Translation to C is left as an
exercise for the reader. :-) --Larry Wall in <7448@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Wed, 16 Apr 1997 22:25:51 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: sed?
Message-Id: <v754j5.gmb.ln@localhost>
[ c.l.p.m was in the headers twice. Not any more ;-) ]
Kin Cho (kin@isi.com) wrote:
: Is there a sed() function that parallels sed,
: just like grep() parallels grep?
Why? What is it you really want to do?
[
Perl's grep() is only kinda sorta like Unix's grep.
They are different in significant ways (like what args they
take, and what 'form' of data they operate on, and even what
regex features can be used...)
]
: I think I've looked, but just in case...
Write it in sed, then let 's2p' translate it into perl.
Then look at what the translated version looks like.
Then do it that way ;-)
: Also, if not, why?
Don't need one 'cause you can do it in native Perl.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Wed, 16 Apr 1997 15:03:30 -0600
From: John Michael Pirie <jmpirie@java.acs.ucalgary.ca>
Subject: Two-Way Sockets in Perl
Message-Id: <33553EA2.7541@java.acs.ucalgary.ca>
I am setting up a simple client-server application in perl,
and am having difficulty with sockets. I have found many examples
of client-server applications, but have been unable to find
any where two-way communication takes place.
If anyone has any sample code that performs this task, I would
be quite grateful. Basically, I want the server to receive a string,
analyze the string, and then return a new string to the same client
from whence it came.
--
John Pirie
The University of Calgary http://www.ucalgary.ca/~jmpirie
Where a calculator on the ENIAC is equipped with 18,000 vacuum tubes
and weighs 30 tons, computers in the future may have only 1,000
vacuum tubes and weigh only 1 1/2 tons. -Popular Mechanics, 1949
------------------------------
Date: 17 Apr 1997 00:04:38 GMT
From: "Tim Behrendsen" <tim@a-sis.com>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <01bc4ac2$d3366700$87ee6fce@timpent.a-sis.com>
Jettero Heller <heller@nacs.net> wrote in article <5j2mh8$q0f@tracy.nacs.net>...
> Ell (ell@access5.digex.net) wrote:
> : jason olmsted (olmstj@phat-media.com) wrote:
> : :
> : : My point is that just because code is released without comments does
> : : not mean that it doesn't exist somewhere else with it. For the
> : : majority of instances, the intened audience of comments is yourself.
> : : Are you going to know what the hell your were thinking two years ago
> : : or even two months ago?
> :
> : Isn't that part of the reason for comments, so that you can recall what
> : sections of code are about?
>
> Yup. exactly. And I agree. But if, as the programmer, I can remember
> what the section of code was about then, I don't need to comment.
> And someone who says "all programmers who release code must comment"
> is saying, "I don't think you can remember what you were thinking
> when you look at this next". Bad news. I have very little problem
> remembering what I was doing in a program several years later. 'tis
> the nature of my memory. If I happen upon some code that I know is
> going to be hard to rememember, I put in a line of comment.
What an idiot. Uh, there is a principle here that you are missing.
Comments are primarily for others, not necessarily for you.
In any case, I get the distinct impression that you have not written
very much code if you are able to remember all of it.
> But don't tell me that because I didn't comment the code I did a
> poor job of writing it. . .
Face up to the fact that there is more to being a good programmer
than banging out code.
--
==========================================================================
| Tim Behrendsen (tim@a-sis.com) | http://www.cerfnet.com/~timb |
| "Judge all, and be prepared to be judged by all." |
==========================================================================
------------------------------
Date: 17 Apr 1997 00:54:04 GMT
From: ell@access1.digex.net (Ell)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <5j3sbc$kh7@news3.digex.net>
Jettero Heller (heller@nacs.net) wrote:
: Ell (ell@access5.digex.net) wrote:
: : jason olmsted (olmstj@phat-media.com) wrote:
: :
: : : My point is that just because code is released without comments does
: : : not mean that it doesn't exist somewhere else with it. For the
: : : majority of instances, the intened audience of comments is yourself.
: : : Are you going to know what the hell your were thinking two years ago
: : : or even two months ago?
: : Isn't that part of the reason for comments, so that you can recall what
: : sections of code are about?
: Yup. exactly. And I agree. But if, as the programmer, I can remember
: what the section of code was about then, I don't need to comment.
Hey, I can dig that you have a terrific memory. If that were the only
reason you wouldn't need to comment.
: And someone who says "all programmers who release code must comment"
: is saying, "I don't think you can remember what you were thinking
: when you look at this next".
Sorry, but when I say "all programmers who release code _should_
comment" what I mean is that they should do so for _maintenance and
enhancement_ programmers.
: But don't tell me that because I didn't comment the code I did a
: poor job of writing it. . .
If you intend for others to maintain or enhance your code then I think you
did do a poor job of writing it. And what if you create some nifty code
that could be extended, but you aren't around to explain it? What a loss.
Whereas if you had commented, others could take your code and fly with it.
Elliott
------------------------------
Date: Thu, 17 Apr 1997 02:10:21 GMT
From: jab@iol.ie (Janus)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <335b4f73.10578287@news.iol.ie>
Gaia dhuit,
Tim Behrendsen dropped 2 cents in the slot and wrote
(in article <01bc491a$6a263f00$87ee6fce@timpent.a-sis.com>):
>Steve Mading <madings@earth.execpc.com> wrote in article
><5ishq7$slr$1@earth.execpc.com>...
>> Tim Behrendsen (tim@a-sis.com) wrote:
>>
>> : Hm; compare PKZIP and gzip (PKZIP includes the gzip algorithm, I
>> : believe). PKZIP includes support for multiple files, spanning
>> : multiple floppies, and a zillion other features.
>>
>> All of which are unnessacery on the Unix systems for which gzip
>> was intended. That's "tar"'s job.
>
<snip>
>Don't get me wrong; I use the tar-gzip combination quite often,
>but it's inferior as a tool compared to archive tools, particularly
>in combination with something like WinZip.
>
Seeing as the original subject refers to ease of use, can I just say
that all the above are inferior as tools in comparison to ZipFolders,
which allows me to use the .zip archive as *just another directory*.
It makes use of such archives completely transparent, and lets me use
any file stored in the archive in the same way as "ordinary" files.
--
janus
Gaia leat
------------------------------
Date: Wed, 16 Apr 1997 23:26:48 -0500
From: Eryq <eryq@enteract.com>
To: mirtos@panix.com
Subject: Re: Wanted: UNIX email parser
Message-Id: <3355A688.74C26629@enteract.com>
mirtos@panix.com wrote:
> Ive looked into MailTools, but there doesnt seem to be anything that
> will do this specifically. Now I can of course simply read thrugh the
> file, and go through all the steps myself, but I'm hoping someone has
> already written a basic parser. (im not looking to send, just to
> extract).
Try MIME-tools. It's in the CPAN. Docs and code on-line also, at:
http://www.enteract.com/~eryq/CPAN/MIME-tools/
HTH,
--
___ _ _ _ _ ___ _ Eryq (eryq@enteract.com)
/ _ \| '_| | | |/ _ ' / Hughes STX, NASA/Goddard Space Flight Cntr.
| __/| | | |_| | |_| | http://www.enteract.com/~eryq
\___||_| \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
|___/ |______/ of the homeless: http://www.streetwise.org
------------------------------
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 320
*************************************