[9144] in Perl-Users-Digest
Perl-Users Digest, Issue: 2762 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 29 16:07:47 1998
Date: Fri, 29 May 98 13:00:27 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 29 May 1998 Volume: 8 Number: 2762
Today's topics:
Re: 'insecure dependency in _____ when using setuid' in <sdh1@anchor.hotmail.com>
Beginner problems with Win32 Perl (James S Kang)
Re: Benchmark: Adding to the end of string (Klaus Kettner)
Re: Benchmark: local filehandle vs. Filehandle.pm (Klaus Kettner)
Re: Checking success of functions (was: Re: list contex (Chip Salzenberg)
Re: Copylefting manuals <barmar@bbnplanet.com>
Re: Copylefting manuals (Leslie Mikesell)
Re: cron job via perl ?? scott@softbase.com
Re: Don't Know how to decrypt using PERL (Leslie Mikesell)
Re: Don't Know how to decrypt using PERL (I R A Aggie)
Re: Don't Know how to decrypt using PERL (Clinton Pierce)
Re: Don't Know how to decrypt using PERL (brian d foy)
Re: Executing a script from html without an HTTP server <sdh1@anchor.hotmail.com>
Fwd: Moz and MacPerl (Chris Nandor)
Re: How to read AND write to a programm? <lr@hpl.hp.com>
Re: How to read AND write to a programm? <bjs@iti-oh.com>
Re: LWP::UserAgent timeout (Charles DeRykus)
parentheses throwing RE match? <james.davis@corp.home.net>
perlish idiom for substitute in many files, only when (Michael Friendly)
quality assurance montiq@my-dejanews.com
Re: read and write (Chip Salzenberg)
Re: SetupSup <JKRY3025@comenius.ms.mff.cuni.cz>
Re: Statistics for comp.lang.perl.misc (Chip Salzenberg)
Re: Using the module install scripts from Win32? (Jonathan Stowe)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 29 May 1998 15:30:19 -0400
From: "Scott" <sdh1@anchor.hotmail.com>
Subject: Re: 'insecure dependency in _____ when using setuid' in HP/UX 10.2
Message-Id: <6kn2if$i94$1@camel19.mindspring.com>
Tom Phoenix wrote in message ...
>On Wed, 27 May 1998, Scott wrote:
>
>> Subject: 'insecure dependency in _____ when using setuid' in HP/UX 10.2
>
>Have you seen what perldiag and perlsec have to say about this?
>>
I guess I need to get my nose out of the books and into the man page...
Thanks guys...
------------------------------
Date: 29 May 1998 18:23:46 GMT
From: carpal@merle.acns.nwu.edu (James S Kang)
Subject: Beginner problems with Win32 Perl
Message-Id: <6kmufi$1o0@news.acns.nwu.edu>
Ok, I'm just starting to mess with perl, and I don't have a book right now.
I'm running a very simple hello world type script that's called by a form
that has this script as its ACTION and uses the POST method.
Now, the first line of the script is supposed to have the location of the
perl interpreter, right? Every example I've seen uses the regular unix
interpreter, so the line looks something like "#! usr/bin/perl".
On this machine, the interpreter is located at C:\apps\Perl5\bin\perl.exe,
so I put in "#! C:\apps\Perl5\bin\perl.exe". Is this right?
I never seem to be able to get it to run. Netscape keeps popping up a window
that says it's going to download it as a file of type application/x-perl.
Does this mean I'm not pointing to the interpreter correctly? If so, how do
I do it?
Please reply through e-mail (jkang@nwu.edu) if you can help.
-Jim
------------------------------
Date: Fri, 29 May 1998 12:36:24 GMT
From: kk@sesom.de (Klaus Kettner)
Subject: Re: Benchmark: Adding to the end of string
Message-Id: <slrn6mtau7.r1n.kk@moon.sesom.de>
On Thu, 21 May 1998 00:19:05 -0400, (Ronald J Kimball) rjk@coos.dartmouth.edu wrote:
>No.
>
>$a =~ s/(?!\n)$/a/;
*THAT* is slow ... ;)
--
-kk-
work: mailto:kk@sbs.de
priv: mailto:kk@sesom.de http://www.n-online.de/~kettner
------------------------------
Date: Fri, 29 May 1998 12:43:27 GMT
From: kk@sesom.de (Klaus Kettner)
Subject: Re: Benchmark: local filehandle vs. Filehandle.pm
Message-Id: <slrn6mtbbe.r1n.kk@moon.sesom.de>
On 20 May 1998 18:47:25 +0300, (jari.aalto@poboxes.com) jari.aalto@poboxes.com wrote:
> After seeing the discussion about the slowness of Filehandle
> package I wanted to see just how slow it would make code.
It doesn't make code slow on my system (P200, 48MB, Perl5.003, Linux 2.0.32).
> a: 27 secs (15.77 usr 10.95 sys = 26.72 cpu)
> b: 84 secs (68.53 usr 14.55 sys = 83.08 cpu)
Benchmark: timing 100 iterations of a, b...
a: 6 secs ( 4.92 usr 0.70 sys = 5.62 cpu)
b: 2 secs ( 1.32 usr 0.69 sys = 2.01 cpu)
--
work: mailto:kk@sbs.de
priv: mailto:kk@sesom.de http://www.n-online.de/~kettner
------------------------------
Date: Fri, 29 May 1998 19:18:25 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Checking success of functions (was: Re: list context: || vs or)
Message-Id: <6kn1ot$1o4$1@cyprus.atlantic.net>
According to tchrist@mox.perl.com (Tom Christiansen):
>In comp.lang.perl.misc,
> Tom Phoenix <rootbeer@teleport.com> writes:
>: defined( $user_id = getpwuid $user_name )
>: or die "No user '$user_name' found: $!";
>
>That's pure superstition.
Sometimes superstitions arise from real concerns.
>Are you trying to tell us you have a user on
>your system whose login name in the passwd file is "0"?
You should be well aware that many security attacks on UNIX systems
involve creation of blank lines in /etc/passwd, which are interpreted
by some getpw*() implementations as users named "" with no password
and uid zero.
And a user name of "" is false.
Using defined() whenever even vaguely appropriate is a very very good
habit. It's like checking the return values of system calls: It isn't
the usual case you're checking for, it's the weird case.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"I brought the atom bomb. I think it's a good time to use it." //MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Fri, 29 May 1998 19:44:35 GMT
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Copylefting manuals
Message-Id: <DeEb1.14$zG3.280199@cam-news-reader1.bbnplanet.com>
In article <pudge-2805982308250001@dynamic265.ply.adelphia.net>,
Chris Nandor <pudge@pobox.com> wrote:
>In article <Cjkb1.48$443.1394311@cam-news-reader1.bbnplanet.com>, Barry
>Margolin <barmar@bbnplanet.com> wrote:
>
># In article <pudge-2805980950440001@dynamic265.ply.adelphia.net>,
># Chris Nandor <pudge@pobox.com> wrote:
># >I did not mean to imply that something is under patent without being
># >registered (although people have gone back and patented things that have
># >been in public use). I am just pointing out that if an example is
># >modified, there is a good chance it won't be considered copyright
># >infringement.
>#
># If the example is modified, the result is a derived work, and still covered
># by the original author's copyright (as well as the modifier's copyright).
>
>Copyright covers only the expression of an idea, not the idea itself.
True, but so what? I wasn't talking about using the ideas, but the code
itself, although in a modified form. For instance, changing the variable
names, or inserting/deleting lines here and there, etc.
In the traditional copyright world of literature, examples of derived works
would be translations into another language, condensations (a la Reader's
Digest), and translations to other media (e.g. a movie based on a book is a
derived work). In the entertainment industry, it seems that this is
interpreted very broadly -- sharing of overall plot structure, but not fine
details like dialogue, is enough to get a plagiarism suit ruled against you
(I think this was the case with Harlan Ellison's suit against the producers
of "Terminator").
--
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
------------------------------
Date: 29 May 1998 14:40:58 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Copylefting manuals
Message-Id: <6kn30a$dsh$1@Venus.mcs.net>
In article <8vmb1.55$443.1516569@cam-news-reader1.bbnplanet.com>,
Barry Margolin <barmar@bbnplanet.com> wrote:
>In article <6kkngp$j14$1@Jupiter.Mcs.Net>, Leslie Mikesell <les@MCS.COM> wrote:
>>Yes, I wish someone would. If you are trying to make something work
>>from (say) Stevens TCP books I don't think you want to wax poetic
>>with arbitrary changes and hope it still works. If you are prohibited
>>from using anything you have read in technical books where you can't
>>make random changes, why would anyone ever look at a book?
>
>I don't know which books you read, but most of the text in most of the
>books I'm familiar with are in human languages, not computer languages.
Sometimes I think programmers can talk for days without saying
an actual word in a human language...
I'm talking about the cookbook sort where the text covers war stories
of how various systems have subtle differences that will kill
you if you do things the wrong way and the examples are essentially
idioms that you have to use to get it right.
>I've never bought a book with the express purpose of copying software from
>it, I buy them to increase my general knowledge about the subject matter,
>so that I can synthesize programs and techniques.
How do you deal with writing things that need to run on or interact
with systems that you can't actually test against?
>However, I could certainly get some ideas about using hashes that I could
>apply to my own programs in the future, and there's nothing wrong with
>that.
How closely would you follow the example if you wanted to make sure
you could store your hash in a file and access it from another
machine with different libraries and byte ordering (assuming that
the book claimed you could do that)?
Les Mikesell
les@mcs.com
------------------------------
Date: 29 May 1998 17:02:56 GMT
From: scott@softbase.com
Subject: Re: cron job via perl ??
Message-Id: <6kmpo0$ro8$1@mainsrv.main.nc.us>
Tina Marie Holmboe (tina@scandinaviaonline.se) wrote:
> *Or* one can use html2ps, a *most excellent* tool (dude), which is
> able to retrieve a document, and traverse same, and convert to PostScript.
> From there on it should be a rather straightforward thing to print it.
*If* you have a PostScript printer. Otherwise, it would create
as many problems as it solved :) One of the nice things about
using the browser's printing features is they'll work with any
printer.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: 29 May 1998 14:18:52 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kn1ms$deo$1@Venus.mcs.net>
In article <6kmv23$2m4@hplntx.hpl.hp.com>, Larry Rosler <lr@hpl.hp.com> wrote:
>>
>> http://sunsite.unc.edu/LDP
>>
>>sunsite has lots of mirrors. It has links to various documentation
>>resources in a variety of formats. Crypt(3) is included in the
>>manpage set.
>>
>.I salt
>is a two-character string chosen from the set
>[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]. This string is used to
>perturb the algorithm in one of 4096 different ways.
>
>Wowee! Now PLEASE tell me how I was supposed to find that out if all I
>had available was my Windows NT, Windows 95 or Windows CE systems???
>
>It sounds as though I would be out of "Good luck".
>
>Please, folks. Get your heads out of the Unix sandbox. Continued blind
>Unix-centrism will hinder Perl, not help it.
AND, keep in mind that there is not one-true-unix. BSD-ish systems
have an 'enhanced' mode described in their man page that you won't
find in the Linux version, and on the odd chance that the passwords
in question were encrypted in that mode (they start with an '_')
you won't match them on Linux either.
By the way, if anyone is familiar with that crypt(), is it reasonable
to take 30 seconds for a perl crypt() to return with certain
patterns on a P300?
Les Mikesell
les@mcs.com
------------------------------
Date: Fri, 29 May 1998 15:15:53 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <fl_aggie-2905981515530001@aggie.coaps.fsu.edu>
In article <6kmv23$2m4@hplntx.hpl.hp.com>, "Larry Rosler" <lr@hpl.hp.com> wrote:
+ Wowee! Now PLEASE tell me how I was supposed to find that out if all I
+ had available was my Windows NT, Windows 95 or Windows CE systems???
Many of those systems will generate a "paranoid" warning about crypt().
+ It sounds as though I would be out of "Good luck".
Without an operational crypt() routine, that's exactly what would be.
+ Please, folks. Get your heads out of the Unix sandbox. Continued blind
+ Unix-centrism will hinder Perl, not help it.
Much of perl *is* unix based. It can't be helped == "You can take the
boy out of the country, but you can't take the country out of the boy".
That said, the orginal question would have been answered with a simple
"perldoc -f crypt":
"Note that crypt is intended to be a one-way function, much like breaking
eggs to make an omelette. There is no (known) corresponding decrypt
function. As a result, this function isn't all that useful for
cryptography. (For that, see your nearby CPAN mirror.)"
That information should be available with every decent version of perl.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 29 May 1998 19:18:46 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kn1mm$mb61@eccws1.dearborn.ford.com>
In article <6kmv23$2m4@hplntx.hpl.hp.com>,
"Larry Rosler" <lr@hpl.hp.com> writes:
>Oh, boy! This was very instructive indeed.
>
>I downloaded 'man-pages-1.19.tar.gz' from that site to my Unix
>workstation. It came across as 'man-pages-1.19.tar' so I renamed it,
>'gunzip'ped it, 'tar xvf'ed it, and found '.../man3/crypt.3' which is an
>nroff file! In that file, I found the following:
>
>..PP
>..I salt
>is a two-character string chosen from the set
>[\fBa\fP\(en\fBzA\fP\(en\fBZ0\fP\(en\fB9./\fP]. This string is used to
>perturb the algorithm in one of 4096 different ways.
>
>Wowee! Now PLEASE tell me how I was supposed to find that out if all I
>had available was my Windows NT, Windows 95 or Windows CE systems???
The same way we UNIX Folk figure out DOS-isms that trip us up all the
time (such as no fork/exec/popen, System V IPC, and DOS filesystems
oddities) without having a DOS box handy--we RTFM.
Seriously! That, and we operate in compatibility mode when we're writing
Perl. Assume that anything that looks cool is impossible, and certainly
not very portable.
No FM? Or the manual is in TROFF format? 5 years ago, you would have
gotten sympathy. There are a plethora of man(1) gateways on the net. I
found the page you wanted (crypt(3)) with excite and the keywords
"+crypt salt". How many Windows ".hlp" gateways are there on the Net?
You went about this the HARD way.
^^^^
>It sounds as though I would be out of "Good luck".
>
>Please, folks. Get your heads out of the Unix sandbox. Continued blind
>Unix-centrism will hinder Perl, not help it.
UNIX makes every effort to make documentation plentiful. Manual pages are
included on every box, and the 'Net has them everywhere. (Hell, you can
even get a First Edition manual online, still!) Freely distributable
versions of the man pages exist, in a lot of different formats.
If you can't find them, then you're using a lousy search engine.
The Net just isn't for warez, porn, stock quotes and pointcast.
To tackle the slur or Perl being UNIX-Centric--yup it is. But then, with
Windows NT rapidly becoming a UNIX OS, I think it's well positioned for
the future. We just have to wait for Redmond to catch up. Could you
ask for a better OS to lean towards? Well documented, seasoned, stable,
freely available in source and binary form? The thought of having a
Windows-centric perl makes me shudder. How many Visual Basic ports to
UNIX are there...?
--
+------------------------------------------------------------------------+
| Clinton A. Pierce | "If you rush a Miracle Man, | http://www. |
| cpierce1@ford.com | you get rotten miracles" | dcicorp.com/ |
| fubar@ameritech.net |--Miracle Max, The Princess Bride| ~clintp |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*
------------------------------
Date: Fri, 29 May 1998 15:57:32 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <comdog-ya02408000R2905981557320001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6kmvm3$2rq@hplntx.hpl.hp.com>, "Larry Rosler" <lr@hpl.hp.com> posted:
>[posted and emailed]
>
>brian d foy wrote ...
>...
>>i have no sympathy for people that can't learn to find things on
>>their own. the unix man pages can be read over the web, and are
>>quite easy to find with something like Yahoo. once found, one
>I presume you would be careful enough to test code snippets before
>posting them. I think the same care should be applied to this kind of
>response.
i'm sorry that you are unable to use a search engine.
>Following your advice, I did this:
>
>I followed the Yahoo! trail down to
><URL:http://www.yahoo.com/Computers_and_Internet/Software/Operating_Syst
>ems/Unix/>. Faced with 31 categories below that, I tried using the
>"Search just this category" facility for 'crypt' and got no matches. So
>I tried "Search all of Yahoo!" and got 10 category matches and 262 site
>matches with crypt.*, none of which had anythoing to do with the C
>library function 'crypt'. Dead end!!!
and of course you gave up and posted to comp.lang.perl.misc because
you expect to be spoonfed. the problem with your philosophy is
that no one ever learns how to do things, and you are the epitome
of that consequence.
i'm sorry that you are stupid. here are the detailed instructions for
idiots:
1. go to <URL:http://www.yahoo.com>
2. in the text widget at the top, type "unix man pages", and select
the submit button. it's a fairly obvious thing to search on.
3. the results page has 4 hits. one says
"Linux Manual Pages [John Martin]". select that or try the other three.
4. one the search form for "Linux Manual Pages [John Martin]", type
"crypt" and select "Section 3 - C Library Routines" from the pulldown
menu. select the "Find" button.
5. you now see the crypt(3) man page. slow modems aside, these five
steps took 15 seconds.
get a clue.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>
this seems to be a Dilbert comic.
------------------------------
Date: Fri, 29 May 1998 15:28:53 -0400
From: "Scott" <sdh1@anchor.hotmail.com>
Subject: Re: Executing a script from html without an HTTP server
Message-Id: <6kn2fr$l8s$1@camel19.mindspring.com>
You can load it directly into your friendly neighborhood web browser as a
file/load command. They can parse html files from your hard drive just as
easily as from the web.
May I suggest Netscape?
John Blackmon wrote in message <356EC7AC.1087A94@gate.net>...
>Is it possible to execute a script (in Perl or any executable for that
>matter) from local HTML on an unconnected machine?
>I am looking at creating a product that would exist only in HTML and it
>needs to access information from a database from information input into
>HTML forms. From what I see, an HTTP server has to process the POST
>method on the form. Does anyone know of a way to do this?
>
>(I know this is not really a Perl question, but it seemed like this
>would be where I would find people who would know the answer to the
>question)
>
>
>- John
>
------------------------------
Date: Fri, 29 May 1998 19:11:02 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Fwd: Moz and MacPerl
Message-Id: <pudge-2905981505230001@dynamic265.ply.adelphia.net>
Path: secnews.netscape.com!not-for-mail
From: Chris Yeh <cyeh@netscape.com>
Newsgroups: netscape.public.mozilla.builds
Subject: [Mac] Announcement: Build System Change
Date: Wed, 27 May 1998 22:15:15 -0700
Organization: Another Netscape Collabra Server User
Message-ID: <356CF2E2.6B16388D@netscape.com>
NNTP-Posting-Host: h-205-217-243-42.netscape.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 4.05 [en] (Win95; U)
What's changing?
===========
Tomorrow, May 28th at approximately 11 am PST, the Macintosh Mozilla
build system will change to a perl based system. Additionally, the new
build system will rely on a "distribution" area for its headers. The
current build system that uses AppleScript will cease to function after
the switchover.
What files are affected?
================
All CodeWarrior projects will be changed to reflect new access paths
that utilize a "dist" area. You will not be able to pull a project out
of the tree and have it build without using the new perl based build
system first.
Why the changes?
============
The change to a perl based build system gives us a number of
advantages. Namely:
* The perl scripts are text files which can be easily merged, as opposed
to binary AppleScript Applets..
* Perl is a more accessible, spoken by more computer people.
* Perl allows us greater flexibility with regards to build
configuration. Build configuration can be as easy as changing a
variable or calling perl functions.
* Perl is faster.
We went with a "dist" type system for exported headers for the following
reasons:
* Conformance to the Windows and UNIX build systems.
* You can now specify a single access path for all necessary header
includes. No more having to specify access paths all over God's green
earth for multiple targets.
* Header exporting can be modified easily, without the need to use a
Macintosh specific tool. Headers to be exported into the dist are now
listed in "export.mac" files and can be easily modified.
You can get yourself a head start by downloading the latest MacPerl
application distribution at
<ftp://sunsite.cnlab-switch.ch/software/platform/macos/perl/Mac_Perl_520r4_appl.bin>
Are you documenting this anywhere?
========================
Yes. The instructions at
<http://www.mozilla.org/docs/tplist/catBuild/macbuild.htm> will be
updated as soon as the switchover is complete. Invoking the new build
system is as simple as a double-click launch of a perl script.
Are you planning to do more build system work?
=================================
Yes. One of the top priorities is to solve the CodeWarrior project
merge problem. Since the CW project file is binary, you can't do diffs
or generate patches of the build configuration. This makes
collaboration and branch merging exceedingly difficult.
We are racking our brains on how to find a workaround to this problem.
If you have a brilliant idea, please e-mail me at cyeh@netscape.com.
Chris Yeh
Release Engineer, mozilla.org
------------------------------
Date: Fri, 29 May 1998 11:57:28 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: How to read AND write to a programm?
Message-Id: <6kn0eh$32c@hplntx.hpl.hp.com>
Mark Seuffert wrote in message <356F0128.EB@NOSPAM.pirate.de>...
>Hi,
>sure I can write to programm, for example to 'sendmail' to send mails.
>But now I have the problem, that I want also read what the programm
>writes back to STDOUT... what I wanna do:
>
>I want to execute this programm:
> /usr/local/bin/nc 194.1.2.3 9000
>then I write the following lines
> EXEC SELECT Name,Email FROM ADRESSEN
> END
>and now I wanna read what the programm writes to STDOUT
>
>Thanks for some code or help! :)
>
>--
>/Moak (delete "nospam" in emailadress)
>http://home.pages.de/~irc ~html ~unix
Look for `` (backquotes) or qx() in the Perl documentation.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Fri, 29 May 1998 15:29:47 -0400
From: "Brian J. Sayatovic" <bjs@iti-oh.com>
Subject: Re: How to read AND write to a programm?
Message-Id: <6kn2j8$a70$1@malgudi.oar.net>
Look at perl's IPC::open2 routine -- it lets you connect filehandles to both
a process's STDIN and STDOUT. Unfortunately, this doesn't work for Win32.
Brian.
Mark Seuffert wrote in message <356F0128.EB@NOSPAM.pirate.de>...
>Hi,
>sure I can write to programm, for example to 'sendmail' to send mails.
>But now I have the problem, that I want also read what the programm
>writes back to STDOUT... what I wanna do:
>
>I want to execute this programm:
> /usr/local/bin/nc 194.1.2.3 9000
>then I write the following lines
> EXEC SELECT Name,Email FROM ADRESSEN
> END
>and now I wanna read what the programm writes to STDOUT
>
>Thanks for some code or help! :)
>
>--
>/Moak (delete "nospam" in emailadress)
>http://home.pages.de/~irc ~html ~unix
------------------------------
Date: Fri, 29 May 1998 18:56:41 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: LWP::UserAgent timeout
Message-Id: <EtqFAH.5Lx@news.boeing.com>
In article <6kk9e3$qa9$1@nnrp1.dejanews.com>, <jk@y4.com> wrote:
>Hello,
>
>I have a small libwww based client that gathers information from numerous
>sites.
>
>Problem:
>LWP::UserAgent times out wonderfully when it can't connect.
>
>However, if the connection completes and then terminates mid-transmission, or
>if the transmission stalls, LWP::UserAgent's timeout doesn't (seem to)
>activate
>and the client hangs (i.e. it doesn't continue on its merry way to the next
>site).
>
>Anyone run into this and devise a solution?
>
>Can one put a timer around the request? If so, what would some sample code be?
>my $req = HTTP::Request->new(GET => $url);
>
>
There's probably a better way but if you're desperate
enough to fork:
if (my $pid = fork) {
eval {
local $SIG{ALRM} = sub { die "timed out" };
alarm 60;
wait;
};
alarm 0;
... # test eval return
} elsif (defined $pid) {
... # do the LWP stuff
} else {
die "fork error: $!";
}
HTH,
--
Charles DeRykus
------------------------------
Date: Fri, 29 May 1998 19:26:46 GMT
From: James Davis <james.davis@corp.home.net>
Subject: parentheses throwing RE match?
Message-Id: <356F0BF6.740CCFA9@corp.home.net>
Am attempting to perform the following:
$key = "Texta (textb)"
$string = "This string contains Texta (textb) and textc"
if ($string =~ /$key/) {
print "KEY found in STRING.";
}
..doesn't seem to work "correctly." Will the parentheses in $key throw
the matching? If so, is there any workaround?
Thanks..
--
James Davis
james.davis@corp.home.net
------------------------------
Date: 29 May 1998 18:55:41 GMT
From: friendly@hotspur.psych.yorku.ca (Michael Friendly)
Subject: perlish idiom for substitute in many files, only when pattern found
Message-Id: <6kn0bd$ic8$1@sunburst.ccs.yorku.ca>
I often use
perl -pi~ -e s/old/new/ *
To make global changes in all files in a directory, but this changes
all the time stamps, even if the /old/ re is not found.
Is there an easy way to make perl revert the ~ file to the original
if no changes are made? Or, how to pipe the list of files (say, from
grep) to perl?
--
Michael Friendly Internet: friendly@hotspur.psych.yorku.ca (NeXTmail OK)
Psychology Dept
York University Voice: 416 736-5115 Fax: 416 736-5814
4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT M3J 1P3 CANADA
------------------------------
Date: Fri, 29 May 1998 19:05:03 GMT
From: montiq@my-dejanews.com
Subject: quality assurance
Message-Id: <6kn0sv$pqc$1@nnrp1.dejanews.com>
i am trying to identify quality assurance, system test and configuration
management professionals. I need to hire 27 people for the New York
M<etropolitan Area. Please help.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 29 May 1998 19:24:21 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: read and write
Message-Id: <6kn242$1p5$1@cyprus.atlantic.net>
According to ilya@math.ohio-state.edu (Ilya Zakharevich):
>It is just that it will not signal EOF on the first iteration.
Why not? Aren't you at the end of file on the first iteration?
Isn't the current position beyond any file contents on the first
iteration? Why act differently?
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"I brought the atom bomb. I think it's a good time to use it." //MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Fri, 29 May 1998 21:05:53 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: SetupSup
Message-Id: <356F85A1.2622@comenius.ms.mff.cuni.cz>
jstephan@my-dejanews.com wrote:
>
> Unfortunately I lost the message that this pertains to. Someone told
> me that I might be able to send keystrokes to another application with
> the module Win32::SetupSup. This is supposed to be located at
> ftp.roth.net/pub/ntperl/SetupSup
>
> That server tells me that the files have moved. The address it points me to
> is the same as the one I just came from.
>
> Anybody know where I can find this module.
>
I don't know would an ftp server could redirect you anywhere, didn't you
try to access the server by http?
The correct&complete URL is ftp://ftp.roth.net/pub/ntperl/SetupSup
I have been there myself last night and it was OK.
Jenda
------------------------------
Date: Fri, 29 May 1998 19:36:22 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <6kn2qi$1q4$1@cyprus.atlantic.net>
According to jimbo@soundimages.co.uk:
>Why should this newsgroup have to endure the copyright
>issues relating to ONE man?
The number of authors isn't relevant.
Which is not to say that the flamefest was.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"I brought the atom bomb. I think it's a good time to use it." //MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Fri, 29 May 1998 19:38:30 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Using the module install scripts from Win32?
Message-Id: <356f0373.29940770@news.btinternet.com>
On Fri, 29 May 1998 14:18:28 +0100, Jeremy Goldberg wrote :
>Is it possible to use the 'install' scripts that seem to come with CPAN
>modules? And if not, how do you put the module in? I assume just copying
>them into the correct directories would do the job, but better to ask people
>who know...
>
If you have the "standard" ( i.e Sarathay's) port then you should have
"dmake" which you use as appropriate instead of "make" as described
in the README file. However if the module has a binary (XS) element
then you will need a supported compiler to install it if a
pre-compiled binary distribution is not available.
On the whole it is generally alright to simply copy the files to the
appropriate location if it is absolutely necessary but there are
modules which do require some configuration for use. You probably
will need to examine Makefile.PL if you are unsure to discover what
it is actually doing.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
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 2762
**************************************