[8941] in Perl-Users-Digest
Perl-Users Digest, Issue: 2559 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 11 19:09:44 1998
Date: Mon, 11 May 98 16:00:47 -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, 11 May 1998 Volume: 8 Number: 2559
Today's topics:
Re: ASCII for arrow keys? <brianm@kodak.com>
Re: ASCII for arrow keys? (Mike Stok)
Re: calculate expressions (Craig Berry)
Re: CGI file writes? (Craig Berry)
Re: Detect if a script is already running? (Ken Williams)
Re: Does Perl have a IDE?I don't like command line. (Ken Williams)
Re: Does Perl have a IDE?I don't like command line. (Stuart McDow)
Re: Does Perl have a IDE?I don't like command line. (Ken Williams)
Re: Does Perl have a IDE?I don't like command line. <neeri@iis.ee.ethz.ch>
Re: Does Perl have a IDE?I don't like command line. <earlw@kodak.com>
Re: Does Perl have a IDE?I don't like command line. (Michael J Gebis)
Re: Does Perl have a IDE?I don't like command line. (Michael J Gebis)
Re: Ever Wonder Why Not Everyone Uses Modules? (Craig Berry)
Help calling Perl script from HTML <rick@eagleweb.net>
Re: Help calling Perl script from HTML <rootbeer@teleport.com>
Help! Can't Pipe Runaway Error Messages topmind@technologist.com
http_referer & frames <john_hong@Non-HP-USA-om42.om.hp.com>
Learning Perl vs Programming Perl (Books) (Treeskunk)
Re: Learning Perl vs Programming Perl (Books) <lanier@shell6.ba.best.com>
Perl for WIN 32 (KLMN2)
Re: Please HELP...dynamic PERL page doesn't display... <rootbeer@teleport.com>
Re: Scanning Perl scripts for Y2K problems (Stuart McDow)
Re: Sender.pm module - Where can one obtain this file? <jkry3025@comenius.ms.mff.cuni.cz>
Significant digit? <yong@shell.com>
Re: substitution of text?? (Craig Berry)
Re: UID = 0 (Stuart McDow)
updating passwd file with 600+ new accounts <teliskyj@kci.wayne.edu>
Re: updating passwd file with 600+ new accounts <brianm@kodak.com>
Re: Win32 Perl Capturing Standard Error <igor.k@usa.net>
Re: writing simple XS functions (Nathan V. Patwardhan)
Writing to multiple sockets with select() <sudarsan.shankar@citicorp.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 11 May 1998 17:25:30 -0400
From: Brian Mathis <brianm@kodak.com>
To: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: ASCII for arrow keys?
Message-Id: <35576CCA.C59F113B@kodak.com>
[posted and emailed]
Ala Qumsieh wrote:
> Hi all,
>
> Does anyone know the ASCII (or hex or anything) representation of the
> arrow keys?
You should probably look at using one of the "User Interface" modules on
CPAN. The arrow keys can be different on every type of system, and
these modules probably make it much easier to deal with them.
Brian Mathis
------------------------------
Date: 11 May 1998 21:58:08 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: ASCII for arrow keys?
Message-Id: <6j7s9g$nfe@news-central.tiac.net>
In article <35575074.F516660F@matrox.com>,
Ala Qumsieh <aqumsieh@matrox.com> wrote:
>Hi all,
>
>Does anyone know the ASCII (or hex or anything) representation of the
>arrow keys?
>I tried something like:
>
>chomp($input = <STDIN>);
>print "ord $input";
>
>as well as similar variations of this .. but I can't get a definite
>answer!
>Any ideas anyone?
What system are you on? You might look at the curses module which allows
you to say
use Curses;
initscr();
...
$ch = getch();
eval
{
if ($ch == KEY_UP) { addstr(22, 0, "KEY_UP was pressed!") }
else { addstr(22, 0, "Something else was pressed.") }
1;
} || addstr(22, 0, "You don't seem to have the KEY_UP macro");
...
Otherwise you generally find that the cursor keys send in escape sequences
e.g. on my system tupoun up, down, left, right and return before EOF gets:
[mike@stok mike]$ od -c
^[[A^[[B^[[D^[[C
0000000 033 [ A 033 [ B 033 [ D 033 [ C \n
0000015
Many systems use ANSI/VT100 escape sequences, but it depends on the system
& whether you're using terminal emulation, a terminal package or using
BIOS to read the hardware as to what you'll see.
There are some potentially useful modules under
.../modules/by-category/08_User_Interfaces on CPAN
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 11 May 1998 21:49:12 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: calculate expressions
Message-Id: <6j7roo$fmu$2@marina.cinenet.net>
Ala Qumsieh (aqumsieh@matrox.com) wrote:
: Hmmmm... not sure where your problem is!
: $result = 5 * $x + (3 * ($x - 5));
: print "Result is $result\n";
:
: Does that answer your question?
: If you mean that $expr is a string that looks like "5*x+(3*(x-5))" ..
: then use eval!
...having first coerced the variables in the string into proper $-first
scalars. For all-alphabetic variable names, the following simple version
of 'bc' provides an example of what can be done:
#!/usr/bin/perl -w
# bc.pl -- A very simple bc-like tool in Perl
# Craig Berry (19980511)
while (<>) {
s/([A-Za-z]+)/\$$1/g;
print eval, "\n";
}
Example of use:
5 + 4
9
x = 12
12
x + 4
16
x += 6
18
x
18
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 11 May 1998 22:29:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: CGI file writes?
Message-Id: <6j7u3g$fmu$3@marina.cinenet.net>
brian d foy (comdog@computerdog.com) wrote:
: In article <894817050.33805@ajatar.dragon.net.au>, "Noel Sampol" <noels@chilli.net.au> posted:
:
: >If I wrote a CGI script that does a file write to a specified server file in
: >my web site,
: >what happens when the CGI script is executed by multiple users
: >simultaneously?
:
: well, what happened when you tried it?
It can be surprisingly difficult to produce simultaneous hits
intentionally. File locking schemes have to be built using careful
design, rather than relying on "I tried to break it and it didn't break."
Lots of people get lulled into a false sense of security by the fact their
unlocking file accesses work for a few days, or weeks, or months, then end
up totally mystified by occasional, apparently random failures.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Mon, 11 May 1998 16:36:37 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Detect if a script is already running?
Message-Id: <ken-1105981636370001@news.swarthmore.edu>
In article <Pine.GSO.3.96.980511115905.21974O-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>On Mon, 11 May 1998, Aloud.com wrote:
>
>> Is there anyway to detect whether a perl script is already running?
>
>There's no general way to do it.
>
>> You could do it really crudely by ps -ef | grep pl ...etc
>
>And that won't always work, even if you know the arguments to ps on your
>system. :-(
>
>But it may be that you could use the methods in Randal's fourth Web
>Techniques column, which explains how to use flock() to avoid problems
>when multiple processes need to modify one file. Hope this helps!
>
> http://www.stonehenge.com/merlyn/WebTechniques/
Good idea - and it occurs to me that if a program wants to know whether
another copy of _itself_ is already running, that's a different problem
than if a user wants to know whether any copies of some arbitrary program
are running.
One simple way to do it is to specify some lock file at the beginning of
the program, like this:
use Fcntl; # imports some constants
my $LOCKFILE = '/usr/whatever/lockfile';
open LOCK, $LOCKFILE or die ("Can't open lockfile $LOCKFILE: $!");
flock(LOCK, LOCK_EX) or die ("I'm already running");
# The lock stays on for the duration of the program, and evaporates when
# this program exits.
This is probably something like what you'll find at Randal's site.
------------------------------
Date: Mon, 11 May 1998 16:24:57 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ken-1105981624570001@news.swarthmore.edu>
In article <6j7iuk$q68$5@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <6j7brt$6g6@mozo.cc.purdue.edu>,
> gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
>: In spite of the slew on non-answers to this question, I
>: don't think that a good IDE (written, of course, in perl
>: using Tk) would be such a bad thing. Especially
>: considering that most people know how to pull down the
>: "help" menu. Certainly more than know how to use
>: perldoc.
>
>Please give us three good reasons why we should stroke even one key to
>help people who refuse to use man, perldoc, or grep? Perl requires at
>least that much of a clue.
Okay, tell me what's wrong with the following classroom teacher:
"Class, I'm not going to lift one finger to help you if you can't read and
understand a simple calculus textbook."
The point is that beginners often lack some basic concepts that never
would have occurred to the people that wrote the man pages. Check out the
beginning of the LLama book, it has a quote by Randal (I think) saying
something like "I didn't learn English by reading the dictionary, and
likewise I didn't learn to program by reading books and man pages." Or
something like that.
Now, I'm not saying that man pages aren't helpful, because of course they
are. I use them all the time. And beginners should definitely refer to
them also. But sometimes it's very difficult to get what you need from
them, because you don't even have a framework in your mind in which to
assimilate the information. Man pages are great when you already know a
function, for example, but can't remember what the order of its outputs
are. They're not so great when you've got a problem to solve and you
don't have a clue about what methods are available and appropriate. The
best thing in that situation is a human being who knows a lot more than
you do about what you're trying to do.
Michael's point was that in an IDE we'd have a chance to make an intuitive
help system. What's wrong with that? It could make more sense to
beginners. If it meant that fewer people would bother you, why wouldn't
you like it?
Of course, I don't have a clue about how one would proceed in writing an
IDE. Perhaps I should go read the man page. Just kidding, I don't mean
that as snide as it sounds.
------------------------------
Date: 11 May 1998 20:26:26 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6j7mti$ped$1@ns1.arlut.utexas.edu>
gbacon@cs.uah.edu (Greg Bacon) writes:
>
> XTerm*background: darkslateblue
> XTerm*foreground: lightblue
Oh, yeah? Try this on for size.
Emacs*background: black
Emacs*cursorColor: green
Emacs*foreground: green
Emacs*font: 6x13
XTerm.vt100.cursorColor: green
XTerm.vt100.background: black
XTerm.vt100.foreground: green
XTerm.vt100.font: 6x13
Clean, clear, crisp. It reminds me of an a video TTY that I used to
use back in (egads!) 1979, when I was a work-study student. They say
that green is supposed to be easy on the eyes....
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Mon, 11 May 1998 16:59:05 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ken-1105981659050001@news.swarthmore.edu>
>Date: Mon, 11 May 1998 13:36:31 -0700 (PDT)
>From: Tom Phoenix <rootbeer@teleport.com>
>
>On Mon, 11 May 1998, Ken Williams wrote:
>
>> Okay, tell me what's wrong with the following classroom teacher:
>>
>> "Class, I'm not going to lift one finger to help you if you can't read and
>> understand a simple calculus textbook."
>
>You aren't comparing someone who is paid to teach to those of us who help
>out in our spare time, are you? When I'm paid to be a teacher, I will help
>my students above and beyond the call of duty; when I help for fun, I stop
>when I see that the questioner isn't willing to work at least as hard as I
>am.
Good point, I hadn't thought of it that way. I agree - as a matter of
fact, I help run a free volunteer-based question-and-answer service for
k-12 mathematics (http://forum.swarthmore.edu/dr.math/ if you're
interested - we won't try to take your money!), and one of the things that
really turns us off is when someone just wants to know the answer and
won't look in our archives or try the problem first.
But, it would still be nice to have a good set of resources to fill the
gap between man pages and "all those nice people on c.l.p.misc who know
all the answers." It sure is tempting for a newbie to write to a
newsgroup rather than spending weeks trying to puzzle out a solution using
man pages, only to end up with bad code in the end because he/she still
don't quite know what he's/she's doing.
I'm not sure what I'm suggesting here, just trying to keep the ball rolling.
------------------------------
Date: 11 May 1998 23:21:17 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <8690o8tsfm.fsf@gwaihir.ee.ethz.ch>
gbacon@cs.uah.edu (Greg Bacon) writes:
> In article <6j7brt$6g6@mozo.cc.purdue.edu>,
> gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
> : In spite of the slew on non-answers to this question, I
> : don't think that a good IDE (written, of course, in perl
> : using Tk) would be such a bad thing.
My own experience with MacPerl has been rather mixed. It seems to me that an
IDE would consist mainly of three components:
a) A text editor optimized toward perl.
b) A graphical debugger frontend.
c) An integrated help system.
My experience was that (a) is essentially impossible. People are going to
prefer their normal editor over any editor written "for perl", especially since
the difficulty of parsing perl makes any possibility of value added service
quite limited.
I have not personally done much work on (b), but it seems to have considerable
potential, from what I have seen of Windowish Perls.
On (c), I'm the most positive that it's possible to achieve considerable
advancements over perldoc with quite limited effort.
> : Especially considering that most people know how to pull down the
> : "help" menu. Certainly more than know how to use perldoc.
What I have done in MacPerl is
- Provide a Help menu offering all of the core pods and some of the library
pods. This just pops up a window with that pod.
- Offer a help index consisting of all core operators and variables and
all module names. This index is accessible on one hand through a "Lookup"
dialog and on the other hand simply by command clicking the symbol that
one would like to have explained. This pops up the correct pod, scrolled
to the correct section.
- For a while, I also offered Balloon Help (Tool Tips for you Windows heathen)
that would give a synopsis for each perl command pointed to. I gave up on
this as I had the impression that this was more disruptive than useful.
> Please give us three good reasons why we should stroke even one key to
> help people who refuse to use man, perldoc, or grep?
- Because, contrary to your zero-sum view of perl newbies vs. experts, a help
system as the above is in my experience useful for everyone.
- Because it keeps those people from posting stupid questions to
comp.lang.perl.misc
- Because it makes Perl more accessible and popular.
> Perl would cease to be the language we know and love if we watered it
> down to meet the needs of the least common denominator.
I don't see where anybody has proposed to "water Perl down". None of the
discussion in this thread so far has suggested a single change to Perl the
language.
Matthias
--
Matthias Neeracher <neeri@iis.ee.ethz.ch> http://www.iis.ee.ethz.ch/~neeri
"Evidently the cleaning lady found him slumped over his Macintosh"
-- Jay McInerney, _Brightness Falls_
------------------------------
Date: Mon, 11 May 1998 17:28:17 -0400
From: Earl Westerlund <earlw@kodak.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <35576D71.4D5D@kodak.com>
Ken Williams wrote:
<snip>
> But, it would still be nice to have a good set of resources to fill the
> gap between man pages and "all those nice people on c.l.p.misc who know
> all the answers." It sure is tempting for a newbie to write to a
> newsgroup rather than spending weeks trying to puzzle out a solution using
> man pages, only to end up with bad code in the end because he/she still
> don't quite know what he's/she's doing.
>
> I'm not sure what I'm suggesting here, just trying to keep the ball rolling.
In terms of a "better help system than the man pages," one that's a bit
more intuitive, I've found that the HTML docs serve very well. Between
them and the Camel and Llama books, I've managed to find just about
every answer I've needed.
Then again, I'm an old Fortran programmer on MVS, and I'm pretty much
happy that I don't have to deal with punch cards anymore... :-)
--
+-----------------+----------------------------------------+
| Earl Westerlund | Kodak's Homepage: http://www.kodak.com |
+-----------------+----------------------------------------+
| The opinions expressed herein are mine and mine alone |
| (most people don't seem to want them anyway) |
+----------------------------------------------------------+
------------------------------
Date: 11 May 1998 22:31:59 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6j7u8v$e29@mozo.cc.purdue.edu>
gbacon@cs.uah.edu (Greg Bacon) writes:
}In article <6j7brt$6g6@mozo.cc.purdue.edu>,
} gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
}: In spite of the slew on non-answers to this question, I
}: don't think that a good IDE (written, of course, in perl
}: using Tk) would be such a bad thing. Especially
}: considering that most people know how to pull down the
}: "help" menu. Certainly more than know how to use
}: perldoc.
}Please give us three good reasons why we should stroke even one key to
}help people who refuse to use man, perldoc, or grep? Perl requires at
}least that much of a clue.
Three good reasons to make the FAQs ridiculously easy to find:
1) To save yourself the inevitable frustration of having to read
the same questions again and again from folks who don't "get"
perldoc, man, or grep.
2) To save yourself the inevitable frustration of having to read or
maintain code from people who never read FAQs.
3) Some people who would generally be considered "clueful" might
even find it useful too.
}Perl would cease to be the language we know and love if we watered it
}down to meet the needs of the least common denominator. An army of Ken
}Thompsons couldn't fully idiot-proof even the simplest program.
So basically, you're counting on people to suddenly get smart. You
optimists make me sick.
One lesson I've taken away from Donald Norman (_The Design of Everyday
Things_) is that if you've got to keep telling people something over
and over again ("Push to Open") you're doing something wrong.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 11 May 1998 22:41:49 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6j7urd$ebi@mozo.cc.purdue.edu>
ken@forum.swarthmore.edu (Ken Williams) writes:
}Now, I'm not saying that man pages aren't helpful, because of course they
}are. I use them all the time. And beginners should definitely refer to
}them also.
Beginners probably remember their experience with "man make" or "man
sed" or "man csh" and how helpful they found those pages when
confused, and don't even bother to try "man perl." Having good man
pages ignores years of tradition. ;)
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 11 May 1998 21:30:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Ever Wonder Why Not Everyone Uses Modules?
Message-Id: <6j7qli$fmu$1@marina.cinenet.net>
I R A Aggie (fl_aggie@thepentagon.com) wrote:
: In article <6iqepc$o71$5@marina.cinenet.net>, cberry@cinenet.net (Craig
: Berry) wrote:
:
: + However, I don't believe that makes CPAN off-limits for criticism. The
: + problems with inadequate module doc, confusing dependencies, and poor
: + correspondence between searchable names and tar-file names mentioned by
: + myself and others are real and can be solved. Doing so would make CPAN a
: + *better* resource.
:
: Ah, congratulations, Craig! Thanks for volunteering to fix these problems!
:
: :) :) :)
Your sarcasm and/or friendly needling are well placed. However, I'll
freely admit to not having sufficient grasp of the detailed innards of
CPAN to *feel* like I could make a useful (non-damaging) contribution to
fixing or improving it. Perhaps I'm understimating myself, I don't know.
But my contributions on this and related threads have been in the spirit
of requirements analysis, rather than design or implementation.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Mon, 11 May 1998 17:58:56 -0400
From: "Richard Durham" <rick@eagleweb.net>
Subject: Help calling Perl script from HTML
Message-Id: <355772f8.0@news4.his.com>
I need to be able to call a perl script from HTML without the intervention
of the user. This script will process a text file and return certain scalar
variables for display in the web page. This needs to be capable of
performing on servers without SSI also.
Any ideas?
Thanks
Richard Durham
rick@eagleweb.net
------------------------------
Date: Mon, 11 May 1998 22:15:30 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Richard Durham <rick@eagleweb.net>
Subject: Re: Help calling Perl script from HTML
Message-Id: <Pine.GSO.3.96.980511151249.21974a-100000@user2.teleport.com>
On Mon, 11 May 1998, Richard Durham wrote:
> I need to be able to call a perl script from HTML without the
> intervention of the user.
You would do this in the same way that you would call a shell script from
HTML, so there's nothing Perl-specific about it. The people in a newsgroup
about HTML and related things should be able to give you an answer which
is more complete and correct than we can give you here. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 11 May 1998 21:45:23 GMT
From: topmind@technologist.com
Subject: Help! Can't Pipe Runaway Error Messages
Message-Id: <6j7rhj$lrp$1@nnrp1.dejanews.com>
I am using Perl 5 with Windows 95, and there seems to be a syntax error in at
least one of the lines that is totally confusing the compiler, thus producing
many lines of errors.
The problem is that I *cannot* seem to redirect the error messages to a file.
I tried various syntaxes, even "more", but I cannot for the life of me see
the first error message because it scrolls past. I tried to Control-S, but
can never catch it.
This is a very frustrating problem that should have a very simple answer.
Anybody have any suggestions?
-Tmind-
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 11 May 1998 14:08:13 -0700
From: John Hong <john_hong@Non-HP-USA-om42.om.hp.com>
Subject: http_referer & frames
Message-Id: <355768BC.76AAF5AD@Non-HP-USA-om42.om.hp.com>
I have a site with navigational bars (in frames) while the main content
is in the target window. (The nav bars are dynamically generated using
cgi/perl).
A site feedback mechanism is located in the frame which takes you to a
feedback form. Is there a way to catch the url of the target window
rather than the url of the frame itself?
Is there a way to manipulate "HTTP_REFERER" to access a target frame?
Any other work arounds?
Perhaps something in the LWP library (though I'm not familiar with it)?
Thanks,
John Hong
------------------------------
Date: Mon, 11 May 1998 18:28:10 -0500
From: Treeskunk@aol.com (Treeskunk)
Subject: Learning Perl vs Programming Perl (Books)
Message-Id: <Treeskunk-1105981828100001@beethoven.triplesoft.com>
I'm a programmer and am interested in both of these books. I would like to get Learning because it talks about CGI. However, I would like to get Programming because I feel it is probably more for programmers. Any suggestions? Is the information from the CGI chapter in Learning available anywhere else (on the net) so if I get Programming I will not miss anything?
Thanks in advance.
--
Treeskunk (aka Mike T.)
------------------------------
Date: Mon, 11 May 1998 15:51:02 -0700
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
Subject: Re: Learning Perl vs Programming Perl (Books)
Message-Id: <Pine.BSF.3.96.980511154901.3327I-100000@shell6.ba.best.com>
yo-
programming perl is a pretty dense book, and i would recommend getting it
concurrently to learning perl, but reading and trying to digest learning
perl first.
i used programming perl primarily as a reference until i felt comfortable
with learning perl, then i gave it a read.
bottom line - get both. you'll be glad... (and so will randall)
matt lanier
matt@lanier.org
matt@saturn5.com
------------------------------
Date: 11 May 1998 21:25:21 GMT
From: klmn2@aol.com (KLMN2)
Subject: Perl for WIN 32
Message-Id: <1998051121252100.RAA10176@ladder03.news.aol.com>
Hi -
I installed Perl for WIN 32 on a Windows NT 4.0 machine
and perl scripts worked fine until the system administrator
changed some secrity settings. Now, perl scripts won't run.
He has tried but he can't fix it.
This is what an Internet browser shows when a perl script is run:
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
That is all that it says. I would appreciate it if anyone could help me.
Please respond to: KLMN2@aol.com
Thanks,
KLMN2
------------------------------
Date: Mon, 11 May 1998 20:11:45 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Ghostwolf <gwolf@ghostwolf.com>
Subject: Re: Please HELP...dynamic PERL page doesn't display...
Message-Id: <Pine.GSO.3.96.980511131031.21974U-100000@user2.teleport.com>
On Mon, 11 May 1998, Ghostwolf wrote:
> This does NOT occur in Netscape (3 or 4) - with these browsers, the page
> works just fine.
Well, then, it's not a Perl problem, since you can get your program to
work.
If you're following the proper protocol but some browser or server doesn't
cooperate, then it's the other program's fault. If you're not following
the protocol, then it's your fault. If you aren't sure about the protocol,
you should read the protocol specification. If you've read it and you're
still not sure, you should ask in a newsgroup about the protocol.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 11 May 1998 20:29:47 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Scanning Perl scripts for Y2K problems
Message-Id: <6j7n3r$q13$1@ns1.arlut.utexas.edu>
steven.chau@ssmb.com writes:
> Hi All,
>
> Does anyone know if there is a tool to scan Perl programs for potential year
> 2000 problems?
Scanning for "localtime" might be a good start...
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Mon, 11 May 1998 21:55:43 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
Subject: Re: Sender.pm module - Where can one obtain this file?
Message-Id: <3557D64F.766B@comenius.ms.mff.cuni.cz>
Tecelote wrote:
>
> It seems I finally found a group that will probably understand my
> situation and be able to help.
>
> I've been asked to help a client with Perl/CGI scripting. So far we're
> doing very well, but now we're at another stall point.
>
> Situation:
>
> My client wants to use his PWS on Win95 as a testbed for his scripts.
> The scripts run correctly we just can't figure out the email problem.
>
> The script is intended to handle the processes of an online job
> application form. The script needs to send an email with the form
> information to his email, write(append) the information to a data file
> and give a response page thanking the individual for their application
> information. The response page and writing to the data file work just
> fine, but we can't figure a way to get the script to send the desired
> email message. It's been suggested we use the sender.pm module, but
> are unable to locate the file. The given URL is either down or not
> responding.
>
> Suggestions to solving this problem would be greatly appreciated.
http://www.fmi.cz/private/Jenda/perl/Sender.pm
http://www.fmi.cz/private/Jenda/perl/Sender.pm.txt
http://www.fmi.cz/private/Jenda/perl/Sender.pm.html
Sorry, the original server went down. I was told that for good.
Jenda
------------------------------
Date: Mon, 11 May 1998 17:15:06 -0500
From: Yong Huang <yong@shell.com>
Subject: Significant digit?
Message-Id: <35577869.F52A7161@shell.com>
I don't want to reinvent the wheel. Did somebody write code to extract
significant digits out of a number? I want to say something like
$newnum=sig_dig($raw,3) where 3 means 3 significant digits and $raw can
be 0.23, .23, 0.2345, 1234.2, 123456... Hope somebody already
implemented the sig_dig function. Thanks.
Note: I didn't find anything by searching in www.perl.com.
Yong Huang
Email:yong@shell.com
------------------------------
Date: 11 May 1998 22:48:00 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: substitution of text??
Message-Id: <6j7v70$fmu$4@marina.cinenet.net>
Andrew Specht (andrew@iaccess.com.au) wrote:
: is there a way in perl to substitute a large number of spaces in a text file
: with just one space?
For space specifically: s/ {2,}/ /g;
For any whitespace: s/\s{2,}/ /g;
Change 2 to whatever constitutes 'a large number' for you.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 11 May 1998 20:31:00 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: UID = 0
Message-Id: <6j7n64$q90$1@ns1.arlut.utexas.edu>
Stephen Hill <stephen@megacrawler.com> writes:
>
> Is there any way to set the UID to 0 so I can write to the password
> file?
When you figure this out, please post the URL. I'd like to check it
out.
:-)
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Mon, 11 May 1998 17:02:11 -0400
From: Jennifer Telisky <teliskyj@kci.wayne.edu>
Subject: updating passwd file with 600+ new accounts
Message-Id: <35576752.4A13FD69@kci.wayne.edu>
I need to quickly update our system with 600+ new accounts. I think the
best way to do this would be with perl. However, I'm extremely new to
perl. Can anyone give me any help on how to ge this done.
I have a dat file that contains the names, usernames, home dir, etc..
I think the best way to start is to perform a "finger" on the username
to make sure the account hasn't been created. For already existing
accounts, write the names out to a "bad file". If the account doesn't
exist , go ahead and create it.
Any snippets, tips, tricks out there would be helpful..
Jennifer Telisky
------------------------------
Date: Mon, 11 May 1998 17:30:49 -0400
From: Brian Mathis <brianm@kodak.com>
To: Jennifer Telisky <teliskyj@kci.wayne.edu>
Subject: Re: updating passwd file with 600+ new accounts
Message-Id: <35576E09.263048AC@kodak.com>
[posted and emailed]
Jennifer Telisky wrote:
>
> I need to quickly update our system with 600+ new accounts. I think the
> best way to do this would be with perl. However, I'm extremely new to
> perl. Can anyone give me any help on how to ge this done.
>
> I have a dat file that contains the names, usernames, home dir, etc..
> I think the best way to start is to perform a "finger" on the username
> to make sure the account hasn't been created. For already existing
> accounts, write the names out to a "bad file". If the account doesn't
> exist , go ahead and create it.
>
> Any snippets, tips, tricks out there would be helpful..
>
> Jennifer Telisky
There is a whole thread that has just been finished up on exactly this
topic (I thought it was the same one at first glance.
Take a look at:
http://x12.dejanews.com/dnquery.xp?search=thread&filter=%7bdb98p2x%20%7b%7b%7ec%20%7b%23*%23%20%26!%20(sex%20%7c%20jobs)%7d%7d%7d%7d&svcclass=dncurrent&threaded=1&ST=PS&CONTEXT=894922221.1989869655&HIT_CONTEXT=894922221.1989869655&HIT_NUM=0&recnum=%3c6istcu$tfe$1@jetsam.uits.indiana.edu%3e%231/1
(Sorry about that url, but it's dejanews' fault)
If the discussion there doesn't help, feel free to bring it up again.
Brian Mathis
------------------------------
Date: Mon, 11 May 1998 13:35:20 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: Win32 Perl Capturing Standard Error
Message-Id: <6j7n6j$l13$1@news.ncal.verio.com>
Ken Chesak wrote in message <35509865.D14D93DC@dhs.state.tx.us>...
>How do I capture standard error when running a perl script. The Perl
>errors just scoll by, I have piped to more and to a file with no
>results. I have set up the following:
>assoc .pl
>ftype Perlscript
>I can execute the perl script by typing: perl script.pl or simply
>script.pl
>
On NT:
perl script.pl > out.txt 2> err.txt
This will redirect your standard output to out.txt and
standard error stream to err.txt
Hope this helps,
Igor Krivokon
<igor.k@usa.net>
------------------------------
Date: 11 May 1998 19:44:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: writing simple XS functions
Message-Id: <6j7ken$r2t@fridge.shore.net>
Ken Williams (ken@forum.swarthmore.edu) wrote:
: I'm trying to get my feet wet learning XS by translating a few functions
: in a module to XS. I have a feeling I'm doing it the hard way, and
: figured this would be a great opportunity to torun to the Perl community
Follow the perlxstut manpage, step-by-step! And when you're done with
perlxstut, read perlxs, too!
--
Nathan V. Patwardhan
------------------------------
Date: Mon, 11 May 1998 20:55:28 +0100
From: Sudarsan Sankar <sudarsan.shankar@citicorp.com>
Subject: Writing to multiple sockets with select()
Message-Id: <355757AF.F2A96354@citicorp.com>
Does anyone know why select() system call flags a socket as ready for
writing even if the listener hasn't executed a read? I am trying to
write a server which will send one record at a time from an input file
to a number of clients. I want the server to block on the select() until
one of the clients has called a read, and then write one record to that
client. But what happens is that once one client has connected, the
select never blocks, and the server keeps writing ahead of the client.
I have tried using syswrite and sysread, as well as turning of buffering
with $| with the same results.
Is this to do with kernel buffering of the socket (The records are quite
small, <100 bytes)? Is there a way to turn it off?
The program I have is as follows:
#After opening SSOCKET and calling listen()
#Set fileno(SSOCKET) into $sdmask. Then..
while (<>) {
select( $sdout=$sdmask, $fdout=$fdmask, undef, undef );
if (vec( $sdout, fileno(SSOCKET), 1 )) {
$numsh++;
accept( "SOCKET_$numsh", SSOCKET ) || die "Cannot
accept";
vec( $fdmask, fileno( "SOCKET_$numsh" ), 1 ) = 1;
syswrite( "SOCKET_$numsh", $_, length($_) );
next;
}
for ($i = 1; $i <= $numsh; $i++) {
if (vec( $fdout, fileno( "SOCKET_$i" ), 1 )) {
syswrite( $temp, $_, length($_) );
last;
}
}
}
I would be grateful for any suggestions, workarounds, pointers.
Sudarsan
------------------------------
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 2559
**************************************