[10026] in Perl-Users-Digest
Perl-Users Digest, Issue: 3619 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 2 14:05:09 1998
Date: Wed, 2 Sep 98 11:00:28 -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, 2 Sep 1998 Volume: 8 Number: 3619
Today's topics:
405 Error fioretti@my-dejanews.com
Re: 405 Error (Bob Trieger)
Re: [Perl] How to find the Perl FAQ (Michael J Gebis)
Re: [Perl] How to find the Perl FAQ (Bob Trieger)
Re: a pesky perl runtime problem <jdporter@min.net>
Re: Change NT IP Address Using Perl <ajaym@hooked.net>
Re: COBOL and Perl <d-edwards@nospam.uchicago.edu>
Re: eliminate *mostly* duplicate array elements <prl2@lehigh.edu>
Re: eliminate *mostly* duplicate array elements (David A. Black)
Re: Encryption & File Locking <rootbeer@teleport.com>
Re: Encryption & File Locking <jim.michael@gecm.com>
Re: History of Perl <rkoehler@osmre.gov>
Re: How do I create a directory only if it doesn't exis <rootbeer@teleport.com>
Re: how to generate random password <eashton@bbnplanet.com>
Re: how to generate random password (Larry Rosler)
Re: how to generate random password <eashton@bbnplanet.com>
Re: MKI$ & CVI functions in QBasic <rootbeer@teleport.com>
MS Word to Text conversion (Ernie Mercer)
opening web-page with perl <kari.nevalainen@iki.fi-SPAM-OFF>
Re: Perl & Java - differences and uses <aboukirev@iname.com>
Re: Perl & Java - differences and uses (David Cantrell)
Re: Perl & Java - differences and uses (Scott Ellsworth)
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl compiler (John Moreno)
Re: Perl Contract Engineer (Mark-Jason Dominus)
Re: Perl Cookbook, does anyone have it? (Mark-Jason Dominus)
Re: Perl gurus opinion needed. <rootbeer@teleport.com>
Re: perl scripts as NT services? (Jonathan Stowe)
Re: Reading a process from a pipe problem <rootbeer@teleport.com>
Re: Reading regular expression from file <cstolpe@acm.org>
Re: Setting DOS environment variables in a perl script wlindley@compuserve.com
Re: simple prog that causes Segmentation fault <rootbeer@teleport.com>
SOLVED: eliminate *mostly* duplicate array elements <prl2@lehigh.edu>
Re: Subtracting two arrays (Larry Rosler)
Re: Subtracting two arrays (Matt Knecht)
Re: Subtracting two arrays (Larry Rosler)
Re: Tom Phoenix: ANSWERS WANTED! (Chris Russo)
Re: Tom Phoenix: ANSWERS WANTED! <gnat@frii.com>
trouble getting df output on remote boxes <jloucks@shell6.ba.best.com>
Re: trouble getting df output on remote boxes <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Weird problem - can you help? <strat@pacifier.com>
Re: Weird problem - can you help? <rootbeer@teleport.com>
Re: Where can I find a Perl script for a non-java, non <rootbeer@teleport.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 02 Sep 1998 16:47:18 GMT
From: fioretti@my-dejanews.com
Subject: 405 Error
Message-Id: <6sjsqn$u48$1@nnrp1.dejanews.com>
Hi,
I'm using Winperl with Apache 1.3.1 for Windows 95.
Why, when I want to run any CGI, I receive an error 405 from my server?
I know it's MIME problem but, what's solution?
Thanks!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 02 Sep 1998 17:13:58 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: 405 Error
Message-Id: <6sjuj3$62r$1@strato.ultra.net>
[ posted to usenet and courtesy e-mail sent to fioretti@my-dejanews.com]
fioretti@my-dejanews.com wrote:
-> Hi,
-> I'm using Winperl with Apache 1.3.1 for Windows 95.
-> Why, when I want to run any CGI, I receive an error 405 from my server?
-> I know it's MIME problem but, what's solution?
And if you knew it was a perl problem you would ask your question in a
MIME newsgroup?
Bob Trieger | `The Best Marketing Service' is spamming
sowmaster@juicepigs.com | with their 800 number. Do them a favor and
call to let the know that spamming is evil
and do it on their dime.
Call (800) 600-0343 Ext. 1373
------------------------------
Date: 2 Sep 1998 16:50:06 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: [Perl] How to find the Perl FAQ
Message-Id: <6sjsvu$ijs@mozo.cc.purdue.edu>
mwang@tech.cicg.ml.com (Michael Wang) writes:
}Martien Verbruggen <mgjv@comdyn.com.au> wrote:
}>> There is a newer version posted by someone called tchrist dated
}>Someone called tchrist?
}>How funny.
}OK, I have corrected the phrase to "someone whoes username is tchrist".
}It is not funny to refer someone by username. It is part of internet
}culture.
tchrist is to perl as christ is to catholicism.
P.S. I like that analogy for all the wrong reasons.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 02 Sep 1998 17:15:32 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: [Perl] How to find the Perl FAQ
Message-Id: <6sjum0$62r$2@strato.ultra.net>
gebis@fee.ecn.purdue.edu (Michael J Gebis) wrote:
-> tchrist is to perl as christ is to catholicism.
Are you saying that Tom is Larry Wall's son?
Bob Trieger | `The Best Marketing Service' is spamming
sowmaster@juicepigs.com | with their 800 number. Do them a favor and
call to let the know that spamming is evil
and do it on their dime.
Call (800) 600-0343 Ext. 1373
------------------------------
Date: Tue, 01 Sep 1998 13:51:35 -0400
From: John Porter <jdporter@min.net>
Subject: Re: a pesky perl runtime problem
Message-Id: <35EC3427.A5E31627@min.net>
Jonathan Feinberg wrote:
>
> "E Mills, software scientist" <eam@starfire.mlb.semi.harris.com> writes:
>
> > I just chased down a bug which was innocuous.
>
> I do not think that word means what you think it means.
Prepare to die...
John Porter
------------------------------
Date: Wed, 02 Sep 1998 10:37:40 -0700
From: Ajay Mittal <ajaym@hooked.net>
Subject: Re: Change NT IP Address Using Perl
Message-Id: <35ED8264.E0BFCBBE@hooked.net>
>
>
>
> Maybe a difference in Service Packs ?? Bare 4.0 is IME as I said
> (I have to setup a roomful of them occasionally), SP3 is supposed
> to fix many things -- maybe they took the chance to enforce *another*
> reboot?
>
true...NT4.0 with SP3 requires the reboot...
------------------------------
Date: Wed, 2 Sep 1998 17:03:45 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: COBOL and Perl
Message-Id: <tgu32qv43y.fsf@noise.bsd.uchicago.edu>
scm@enterprise.net (Shaun C. Murray) writes:
> >What follows is a complete perl program.
> >On unix, you might put it in a file named (e.g.) "untab", and
> >execute it by "perl untab < infile > outfile" (no quotes, of course).
> >
> ># let's just say the desired field widths are known to be these:
> >@field_widths = qw( 8 12 15 20 10 );
> ># read from stdin or the named files; write to stdout.
> >while(<>){
> > printf "@{[map{'%'.$_.'s'}@field_widths]}", split /\t/;
> >}
>
>
> Looks mostly like line noise to me which is my biggest complaint with trendy
> languages.
Obviously if one doesn't know the syntax of a language, getting
semantics out of a particular utterance in the language is going
to be tricky; that doesn't seem to me to be peculiar to perl though.
(I haven't understood any of the (really _very_ few) lines of COBOL
I've seen; does that mean COBOL is bad, or just that I should learn
COBOL syntax before trying to parse COBOL (for semantics)?)
> Excess punctuation too.
<AMADEUS>
"Too many notes."
</AMADEUS>
:)
Darrin
------------------------------
Date: Wed, 2 Sep 1998 11:08:04 -0400
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: Re: eliminate *mostly* duplicate array elements
Message-Id: <6sjn0r$2114@fidoii.cc.Lehigh.EDU>
I hacked together the following *ugly* solution. It removes whitespace for purpose of comparison, and then discards items from the
original array based on whether their position has been noted as a duplicate.
Please, somebody save me from this ugly monster! Is there a more beautiful way?
#!/usr/local/bin/perl -w
use diagnostics;
use strict;
my @list_raw = (' hi', ' hallo', 'hallo', 'hey');
my @temp_list = @list_raw;
foreach (@temp_list) {s/\s//g;}
my $position = 0;
undef my %saw;
my @duplicates;
foreach (@temp_list) {
unless (grep(!$saw{$_}++, $_)) {
push @duplicates, $position;
}
$position++;
}
$position = 0;
my @list;
foreach (@list_raw) {
unless (grep /$position/, @duplicates) {
push @list, $_;
}
$position++;
}
print "@list\n";
------------------------------
Date: Wed, 2 Sep 1998 13:46:20 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: eliminate *mostly* duplicate array elements
Message-Id: <6sk09c$bj2$1@earth.superlink.net>
Hello -
I'm not entirely sure if this does everything you want to do, but you
could try something like:
my @list = ("hello there", " hi", " hello there\n\n", " Hello!", "hi ");
my @newlist = values %{ {map { $x=$_; do{s/\s//g;$_}, $x } @list1} };
as long as you don't care which of multiple possible elements gets kept.
(Am I missing the role of position/index within the array?)
Also, remember (if it's relevant to your actual data) that
" hi there"
and
"hit here"
will count as duplicates.
David Black
dblack@saturn.superlink.net
"Phil R Lawrence" <prl2@lehigh.edu> writes:
>I hacked together the following *ugly* solution. It removes whitespace for purpose of comparison, and then discards items from the
>original array based on whether their position has been noted as a duplicate.
>Please, somebody save me from this ugly monster! Is there a more beautiful way?
>#!/usr/local/bin/perl -w
>use diagnostics;
>use strict;
>my @list_raw = (' hi', ' hallo', 'hallo', 'hey');
>my @temp_list = @list_raw;
>foreach (@temp_list) {s/\s//g;}
>my $position = 0;
>undef my %saw;
>my @duplicates;
>foreach (@temp_list) {
> unless (grep(!$saw{$_}++, $_)) {
> push @duplicates, $position;
> }
> $position++;
>}
>$position = 0;
>my @list;
>foreach (@list_raw) {
> unless (grep /$position/, @duplicates) {
> push @list, $_;
> }
> $position++;
>}
>print "@list\n";
------------------------------
Date: Wed, 02 Sep 1998 16:59:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Encryption & File Locking
Message-Id: <Pine.GSO.4.02A.9809020958160.29974-100000@user2.teleport.com>
On Tue, 1 Sep 1998, Vinay Gidwaney wrote:
> I'm trying to encrypt a data file in perl... is there a way to do
> that?
Yes. Maybe you want one of the modules from CPAN?
> Also, when the perl script accesses the file, what are the
> procedures to lock the file so that it can't be accessed by another
> instance of my perl script?
I think 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/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 12:50:34 -0400
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: Encryption & File Locking
Message-Id: <35ED775A.7AD2@gecm.com>
Vinay Gidwaney wrote:
> I'm trying to encrypt a data file in perl... is there a way to do that?
> Like when the script wants to access the file, it unencrypts it, and then
> does what it needs to do, and then encrypts it again... are there any
> examples i can take a look at...
Depends on the strength of encryption you need. If DES is sufficient,
and you have des installed, then you might use something like:
system "cat /myserver/mydir/$myfile | des -dk $mypassword >
/myserver/mydir/$mydecryptedfile";
Then when you are done with the file, write it back to the encrypted
file:
system "cat /myserver/mydir/$mydecryptedfile | des -ek $mypassword >
/myserver/mydir/$myfile";
> Also, when the perl script accesses the file, what are the procedures to
> lock the file so that it can't be accessed by another instance of my perl
> script?
perldoc -f flock
Or, use a semaphore file.
Cheers,
Jim
------------------------------
Date: Wed, 2 Sep 1998 16:05:00 GMT
From: "Rick Koehler" <rkoehler@osmre.gov>
Subject: Re: History of Perl
Message-Id: <EynzB3.4H8@igsrsparc2.er.usgs.gov>
Micah wrote in message <35EC5837.B357034B@noewhere.com>...
>Im looking for a site with a good history on Larry Wall and how Perl
was
>first started to add to some of the other information I have for a book
>I am writting. If you know of a good URL I woudl appreciate it if you
>could pass it along.
One place is in ActiveState's ActivePerl distribution (5.005_02), within
their online documentation. Look for index.html at the highest level
of the documentation installation path, as in:
<Drive:\perl5\5.00502\html\index.html>
and then seek "perlhist" and ye shall find. Just what ye shall find is
a brief history of the various releases. It is not the longer narrative
of which several here in c.l.p.m. have mentioned ... I can't
remember where I saw that one, either. But it was good.
BTW, someone mentioned, essentially, "going to the source", as
in Mr. Wall or O'Reilly publications, etc. Good idea that.
Fare thee well.
------------------------------
Date: Wed, 02 Sep 1998 17:10:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How do I create a directory only if it doesn't exists
Message-Id: <Pine.GSO.4.02A.9809021008480.29974-100000@user2.teleport.com>
On Wed, 2 Sep 1998, Rolf Rettinger wrote:
> is there any function like sysopen for a file to create a directory
> only if it doesn't exists?
Yes; if you successfully create a directory, it didn't exist before.
Doesn't it work that way on your system? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 16:22:26 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: how to generate random password
Message-Id: <35ED6E6D.762EA2AD@bbnplanet.com>
heres an example of how you might do it. enjoy.
e.
########################################################################
# Name: randomPass [length]
#
# Purpose: generate a random password of 'length' characters,
# default is 8.
#
# Arguments:
# length - the length of the random password to generate - default
is 8
#
# Returns:
# passwd - the random password string generated
#
########################################################################
sub randomPass {
my $len = shift;
my $passwd;
my @charset = split //, '23456789ABCDEFGHIJKLMNPQRSTUVWXYZ';
length ($len) < 1 and $len=8;
do {
$passwd = '';
for ($i = 0; $i < $len; $i++) {
strapp \$passwd, $charset[rand($#charset)];
}
} until validPassword($passwd);
$passwd;
}
------------------------------
Date: Wed, 2 Sep 1998 09:59:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how to generate random password
Message-Id: <MPG.1057196a6262bb49989787@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <35ED6E6D.762EA2AD@bbnplanet.com> on Wed, 02 Sep 1998 16:22:26
GMT, Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> says...
...
> for ($i = 0; $i < $len; $i++) {
> strapp \$passwd, $charset[rand($#charset)];
> }
> } until validPassword($passwd);
What are strapp and validPassword?
How about just this:
sub Rand { # string = Rand(number_of_characters)
my @chars = ('A' .. 'Z', 'a' .. 'z', '0' .. '9');
join "" => @chars[ map rand @chars => 1 .. shift ]
}
I saw something like it here recently; I think it qualifies for the
elegance award.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 02 Sep 1998 17:08:46 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: how to generate random password
Message-Id: <35ED7949.5094D960@bbnplanet.com>
its the beauty of perl, there is always more than one way to do it and
plenty of people to tell you so. it was an example, not a solution.
e.
------------------------------
Date: Wed, 02 Sep 1998 17:45:53 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: MKI$ & CVI functions in QBasic
Message-Id: <Pine.GSO.4.02A.9809021044210.29974-100000@user2.teleport.com>
On Wed, 2 Sep 1998 xvisualbasic@my-dejanews.com wrote:
> I would like to know the equivalent functions of MKI$ & CVI of QBasic
> in Perl. MKI$ converts numbers into numeric strings and CVI does the
> reverse.
This is like asking how to rewind a floppy disk. :-)
Perl automatically converts between numbers and strings as needed. Is that
what you were trying to do? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 17:10:56 GMT
From: emercer@wma.com (Ernie Mercer)
Subject: MS Word to Text conversion
Message-Id: <35ed7a77.415180768@news.wma.com>
I'm in urgent need of a Perl module/script (heck, any command line
application) that can be used to convert larger numbers of MS Word
(.doc) documents into plain text (.txt) files. Anyone know of such a
critter? Thanks.
Ernie Mercer
emercer@wma.com
------------------------------
Date: Wed, 02 Sep 1998 19:26:24 +0300
From: Kari Nevalainen <kari.nevalainen@iki.fi-SPAM-OFF>
Subject: opening web-page with perl
Message-Id: <35ED71B0.3D5C@iki.fi-SPAM-OFF>
Hi,
how can you open certain URL in you browser?
I have a form where people can identify their nationality,
If I would like to open my English homepage to people who does NOT come
from Finland and open my Finnish homepage to people who do.
How should I program that with Perl?
thx
--kari--
------------------------------
Date: Wed, 2 Sep 1998 11:28:22 -0500
From: "Alexei Boukirev" <aboukirev@iname.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <hteH1.213$H3.496372@nntp0.chicago.il.ameritech.net>
Nope, it should be C(\+{2})? if you didn't have in mind something more.
Alex.
David Cantrell wrote in message <35ee5d72.79567341@thunder>...
>In my previous post, I should have pointed out that if you want to
>program for the net (as opposed to just for the www part of it) you
>should learn C(\+{2})+ as well as perl.
>
>--
>Dave, who counts himself lucky that he doesn't have to
> use C/C++ all that often. perl's far more fun.
------------------------------
Date: Wed, 02 Sep 1998 16:54:48 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl & Java - differences and uses
Message-Id: <35ed7810.86381780@thunder>
On Wed, 2 Sep 1998 11:28:22 -0500,
"Alexei Boukirev" <aboukirev@iname.com> enlightened us thusly:
>Nope, it should be C(\+{2})? if you didn't have in mind something more.
You're right - oops.
>David Cantrell wrote in message <35ee5d72.79567341@thunder>...
>>In my previous post, I should have pointed out that if you want to
>>program for the net (as opposed to just for the www part of it) you
>>should learn C(\+{2})+ as well as perl.
Make it C(\+{2}){0,1} just to add a fe more bizarro characters ;-)
--
David Cantrell, part-time NT/java/SQL techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Wed, 02 Sep 98 16:54:11 GMT
From: scott@eviews.com (Scott Ellsworth)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6sjt3c$j7r$1@news01.deltanet.com>
In article <35ED5258.5CC309BE@shell.com>, yong <yong@shell.com> wrote:
>I have a feeling that the Perl people generally don't like Java very much and
>the Java people don't like Perl much either. I personally prefer Perl since I
>think it requires less memorizing. If you use Java, almost always you have to
>have a language reference (API reference) on your desk, unless you already
>learned so many things by heart and possibly got certified by Sun. To program
> in
>Perl, or C (another language that doesn't heavily rely on complicated API's),
>you can start right away.
On the other hand, the docs that I need to have to program Java are
available as a set of web pages. While it helps to have better docs,
much like the camel book does in Perl, they are not needed for the
typical tasks, even if you have not memorized the entire API. I find
the things I need the API reference for are almost always graphics,
for which I needed the Tcl/Tk books when I was working in Python,
and (I suspect) Perl.
FWIW, I find more crosstalk between Perl people and Java people than
between Python and Perl people. In my experience, the good Python
people do not like Perl very much and the good Perl people do not
like Python very much. Since they are both strong for similar tasks,
imho, this surprised me a bit.
I am in the Python camp. Python connects well with how I think when I
am doing straightforward report extraction and text/data maniputation.
Perl does not. If you are wired a bit differently, it will go the
other way.
Scott
Scott Ellsworth scott@eviews.com
"When a great many people are unable to find work, unemployment
results" - Calvin Coolidge, (Stanley Walker, City Editor, p. 131 (1934))
"The barbarian is thwarted at the moat." - Scott Adams
------------------------------
Date: Tue, 01 Sep 1998 13:39:04 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35EC3138.538E0538@min.net>
Jim wrote:
>
> As a young(17) and budding internet page designer...
Then allow me, as an old usenaut, to give you a friendly
tidbit of advice:
Never, EVER ask questions like "which language is
better" in more than one newsgroup. And try to
make sure you're familiar with the culture of the
newsgroup before you do it in just one.
Please, people, let's not go through all this again.
Thanks,
Respectfully,
John Porter
------------------------------
Date: Tue, 01 Sep 1998 13:56:06 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35EC3536.D0BAFCB3@min.net>
Scott Ellsworth wrote:
>
> FWIW, I find more crosstalk between Perl people and Java people than
> between Python and Perl people. In my experience, the good Python
> people do not like Perl very much and the good Perl people do not
> like Python very much. Since they are both strong for similar tasks,
> imho, this surprised me a bit.
Seems to me this should be the UNsurprising effect.
Because Perl and Python address similar problem domains,
there's a kind of turf war for mind space between them;
whereas Java and Perl can peacefully coexist in my head (e.g.)
because I do different things with them.
Between Perl and Python I would have to choose.
John Porter
------------------------------
Date: Wed, 2 Sep 1998 12:01:06 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: Perl compiler
Message-Id: <1deq96r.q60sbifsssgN@roxboro0-018.dyn.interpath.net>
In comp.lang.perl.misc Joe McMahon <joe.mcmahon@gsfc.nasa.gov> wrote:
> What I'm failing to understand is this.
-snip-
What I fail to understand is why you posted this in reply to my message
without including any of what I wrote or addressing (except indirectly
in this last paragraph) what I said.
> Breaking a security method -- whatever method -- will not cost them any
> money, unless there is a specific agreement that says they know that they
> are breaking a contract with you if they even try it.
Breaking security can be more serious than breaking a contract - it
results in jail time and not lost money (companies aren't concerned with
this but the executives who might end up in jail probably do).
--
John Moreno
------------------------------
Date: 2 Sep 1998 13:35:28 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl Contract Engineer
Message-Id: <6sjvl0$eb3$1@monet.op.net>
In article <1dehx04.bpb4al15b2v9uN@bay1-148.quincy.ziplink.net>,
Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
><@san.rr.com> wrote:
>> Please contact via email or phone.
>
>The former may be difficult, since your email address does not include a
>username.
I saw this one when he submitted it to the moderated group.
The software sent him a registration form, which bounced, of course.
Do you think I should have called him collect to tell him that his
article was rejected?
------------------------------
Date: 2 Sep 1998 13:16:54 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <6sjui6$e5t$1@monet.op.net>
In article <35EABE04.7AACA0CD@min.net>, John Porter <jdporter@min.net> wrote:
>Mark-Jason Dominus wrote:
>>
>> 12 kilos rice
>
>Typo -- should be 120 kilos of rice.
Yes. And I wonder if 60 eggs are enough. After you finish stuffing
eggs into 20 chickens, there aren't going to be very many left to
garnish it like it says you should.
------------------------------
Date: Wed, 02 Sep 1998 17:38:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl gurus opinion needed.
Message-Id: <Pine.GSO.4.02A.9809021022100.29974-100000@user2.teleport.com>
On Wed, 2 Sep 1998, Dmitry Dorofeev wrote:
> I have possibly{0,1} new word for general purpose use.
> it's sounds 'Perlacker'.
>
> Hope it can replace well known 'Perl Hacker' pair
> and save some paper and disk space :-)
> actually only 2 bytes per old pair:-(
>
> Problem: I am not native English speacker. May
> be Perlacker has some associations with NOT good things?
Yes, it could be mis-interpreted as "Perl lacker". "To lack" is a
moderately-common verb meaning to not have something, so that could imply
someone who does not have Perl!
A little over a year ago, just after the first Perl Conference, I asked
Larry and some others if they knew of a good collective noun for Perl
programmers, developers, or hackers. So far, I haven't seen anything worth
propagating.
But I like the idea of calling folks who work on the Perl documentation
"POD people". :-)
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 17:12:18 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: perl scripts as NT services?
Message-Id: <35ed7a19.466752@news.btinternet.com>
On Tue, 01 Sep 1998 20:56:40 +0000, Chris Roelle wrote :
> Hello -
>
> does anyone know how i can run a perl script
>as an NT service? just need to get it going at
>boot-up, as a regular user (who could be an Admin,
>i guess), without automatically logging in. help/http/ftp
>addresses w/ instructions welcome, of course, as i
>would gladly rtfm, if i could find one....
>
There are some facilities on the NT Server resource kit CD that make
this possible. This has been asked here recently (and answered in
depth) you could therefore get the answer via DejaNews. However here
is the previous response:
kingm1706@my-dejanews.com wrote:
>
> Use the instsrv.exe and srvany.exe that come with the Windows NT Resource kit
> to install any program (including a PERL app) as a service.
>
> It goes something like this -- go into the directory where your perl code is:
>
> c:\path to file\instsrv YOURPERLCODENAME c:\path to file\srvany.exe
>
> Then, start Registry Editor and look for:
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\YOURPERLCODENAME
>
> Select Edit, New, Key and create a "Parameters" key.
> Select Edit,New,String Value and create the following keys:
>
> Application c:\perl\bin\perl.exe
> AppParameters c:\path to file\yourperlcode.pl
> AppDirectory c:\path to file
>
> Then go to the Control Panel, Services. Find YOURPERLCODENAME, select it, and
> click on Startup.
> Make the Startup type AUTOMATIC and make Log On As: administrator (or another
> user with comparable
> access).
>
> That's the way to do it!
>
> --Michael King
> --VM Online
> --Temecula, CA USA
Of course this is not Perl specific and would better have been asked
in a group interested in the NT platform.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Wed, 02 Sep 1998 17:06:26 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Reading a process from a pipe problem
Message-Id: <Pine.GSO.4.02A.9809021001270.29974-100000@user2.teleport.com>
On Wed, 2 Sep 1998 purring@earthlink.net wrote:
> in an attempt to overlap 2 processes I got this error.
I think you're saying that you had two processes, besides your controlling
perl process, running at once.
> what I was trying to do is start a `cvs checkout'
> and then when I get enough files checked out start
> a make, while the `cvs checkout' continues.
No problem with that, in principle. But if make needs any files that
aren't ready yet, you'll be in trouble. In any case, this looks like an
overzealous optimization. Do you also try to read the newspaper while
you're driving to work? :-)
But it may also be that cvs is having some difficulties because make is
doing something it doesn't expect. It's probably best to run cvs to
completion before starting make. Or, have make do the checkout as one of
its targets, perhaps?
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 11:43:02 -0400
From: Chris Stolpe <cstolpe@acm.org>
Subject: Re: Reading regular expression from file
Message-Id: <35ED6785.EAC42D47@acm.org>
I used chop because I have an old perl 4 book. I realized it wasn't working
because I put the $regx = <EXPR> in a loop by mistake. When it reached EOF my
regular expression became ^() which matched every line.
Thanks
Chris
Tom Phoenix wrote:
> On Tue, 1 Sep 1998, Chris Stolpe wrote:
>
> > $regx = <EXPR>; # <= doesn't work.This works => $regx = "Foo|Bar";
> > chop($regx); # just for when reading from file
>
> You could use chomp, instead of chop; that's exactly what it was invented
> to do.
>
> > if (/^($regx)/) {
>
> That should work. Could you have a problem with some backslash escapes
> which are being interpreted at the wrong time or not at all? Or could it
> be that you're not reading from the file at all - have you checked the
> return value from open? Have you printed out the pattern to be sure that
> it's the one you were expecting?
>
> > Does it work when I set it to a string because perl knows the value of
> > the string when it compiles the script but doesn't when I read from the
> > file because it doesn't know the value? How can I work around this?
>
> The discussion of the /o option in the perlop manpage may help you here.
> Hope this helps!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 17:36:01 GMT
From: wlindley@compuserve.com
Subject: Re: Setting DOS environment variables in a perl script
Message-Id: <6sjvm1$1kr$1@nnrp1.dejanews.com>
It is possible -- in C at least -- to modify the parent's environment. To do
so you must manipulate the PSP (program segment prefix), so this is a tall
order in Perl.
Refer to: "Accessing the MS-DOS Master Environment," Scott Ladd, C Users
Journal, July 1989, page 52;
\\/
William Lindley
http://ourworld.compuserve.com/homepages/wlindley
"Does anyone else think the Imac looks like a hotrod ADM-3?"
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 02 Sep 1998 16:56:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: simple prog that causes Segmentation fault
Message-Id: <Pine.GSO.4.02A.9809020955130.29974-100000@user2.teleport.com>
On 30 Aug 1998, Pascal Rigaux wrote:
> Subject: simple prog that causes Segmentation fault
If it still causes a segfault under 5.005, please use the perlbug command
to report it. Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 2 Sep 1998 11:39:26 -0400
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: SOLVED: eliminate *mostly* duplicate array elements
Message-Id: <6sjorg$22q2@fidoii.cc.Lehigh.EDU>
Thanks to Sean McAfee and Maurice Aubrey, who both provided the following answer:
@list = grep { (my $x = $_) =~ s/\s+//g; !$saw{$x}++ } @raw_list;
Thanks,
Phil
------------------------------
Date: Wed, 2 Sep 1998 09:00:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Subtracting two arrays
Message-Id: <MPG.10570b876e13b30798981f@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6sjnt8$o75$1@nnrp1.dejanews.com> on Wed, 02 Sep 1998 15:23:21
GMT, zix6@yahoo.com <zix6@yahoo.com> says...
?> I have two arrays of the same length and I want to substract them
element by
?> element to create a new array:
?>
?> @array1 = (1,2,3);
?> @array2 = (4,5,6);
?> for ($i = 0; $i <= $#array1; ++$i)
?> {
?> push(@array3, $array2[$i] - $array1[$i]);
?> }
?> print @array3;
?>
?> Is there a simpler more "Perl like" way to do this?
@array3 = map $_ - shift @array1 => @array2;
Simpler and more "Perl like", IMO.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 02 Sep 1998 16:52:58 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Subtracting two arrays
Message-Id: <KJeH1.358$7%3.1042924@news2.voicenet.com>
Larry Rosler <lr@hpl.hp.com> wrote:
>@array3 = map $_ - shift @array1 => @array2;
>
>Simpler and more "Perl like", IMO.
Or even:
@array3 = map { $_ - $array1[$i++] } @array2;
For those of us who love extra punctuation ^W^Wreadability.
This also has the benefit of not destroying @array1 (But its slower).
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: Wed, 2 Sep 1998 09:50:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Subtracting two arrays
Message-Id: <MPG.105717273a01c07d989786@nntp.hpl.hp.com>
In article <MPG.10570b876e13b30798981f@nntp.hpl.hp.com> on Wed, 2 Sep
1998 09:00:45 -0700, Larry Rosler <lr@hpl.hp.com> says...
...
> @array3 = map $_ - shift @array1 => @array2;
Of course, this destroys @array1. If you want to keep it, copy it first
and then shift on the copy.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 02 Sep 1998 08:48:58 -0700
From: news@russo.org (Chris Russo)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <news-0209980848580001@buzz.hq.alink.net>
In article <vx%G1.72$kE2.588848@news.shore.net>, nvp@shore.net (Nathan V.
Patwardhan) wrote:
>It's unfortunate that people read the posting as an attack on Tom's
>character, which it was not. [...]
No, it's not. It's an attack on his posting style - a very sad one.
If you're not just trolling, go find some higher priority clpmisc problems
to tackle.
Thanks,
Chris Russo
--
Chris Russo
news@russo.org
http://www.russo.org
------------------------------
Date: 02 Sep 1998 10:12:20 -0600
From: Nathan Torkington <gnat@frii.com>
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <5qemtua3yz.fsf@prometheus.frii.com>
John Porter <jdporter@min.net> writes:
> JMHO, and nothing agains Tom P, who is a great guy and a fine,
> upstanding citizen in our increasingly fractious community.
Fractious? Come HERE and I'll GIVE YOU fractious!
Nat
(comp.lang.perl.moderated? Fucking splitters!)
------------------------------
Date: 2 Sep 1998 17:40:46 GMT
From: Jim Loucks <jloucks@shell6.ba.best.com>
Subject: trouble getting df output on remote boxes
Message-Id: <6sjvuu$pgp$1@nntp1.ba.best.com>
I've been trying to get perl to run the df command on remote
machines without success. I'm new to perl. Here's what I'm doing:
First I open a file with about 10 hostnames in it. Put each
hostname in the variable "hosts" and call the getdf subroutine.
This works so easily in ksh it can't be that difficult in perl...
The error checking was pulled from the camel book on page 230
where it defines the perl system function.
What happens is the system function call works, but it logs me
into the remote machine instead of executing a remote df command.
When I exit the login, the df command executes - not what I want!
Here's the part that ain't working, I'd appreciate any help:
#!/usr/bin/perl
open(hosts, "/usr/local/etc/hosts") || die "Cannot open /usr/local/etc/hosts\n";
while (<hosts>) {
$host=$_;
&getdf;
}
sub getdf {
@args = ("rsh $host df -kl");
$rc = 0xffff & system @args;
printf "system(%s) returned %#04x: \n", "@args", $rc;
if ($rc == 0) {
print "Ran with normal exit\n";
}
elsif ($rc == 0xff00) {
print "Command failed: $!\n";
}
elsif ($rc > 0x80) {
$rc >>= ~0x80;
print "Ran with non-zero exit status $rc\n";
else { }f ($rc print "Core dump from ";
print "signal $rc\n";
}
}
------------------------------
Date: 02 Sep 1998 19:52:23 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: trouble getting df output on remote boxes
Message-Id: <7x3eaa5rmw.fsf@salome.vcpc.univie.ac.at>
Re: trouble getting df output on remote boxes, Jim
<jloucks@shell6.ba.best.com> said:
Jim> while (<hosts>) { $host=$_; &getdf; }
Urgh, parameter? &getdf($host);
You need to get rid of the newline off of the line you read
from the hosts file, viz.
while (<hosts>) {
chomp;
&getdf($_);
}
Jim> sub getdf {
my $host = shift; # get passed in parameter
Jim> ....
Jim> }
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Wed, 2 Sep 1998 09:05:47 -0700
From: "Christian Brink" <strat@pacifier.com>
Subject: Re: Weird problem - can you help?
Message-Id: <35ed6cec.0@news.pacifier.com>
Have you tried this manually with an FTP client?
C. Christian Brink,CNE
IS-Manager
All-Sports Supply, LLC
Clackamas,OR
strat@pacifier.com
chrisb@assi.com
Raj Subramani wrote in message <35ED2433.8E40E9C8@citicorp.com>...
>Please look at this ftp script that I wrote:
>
>(NOTE: Please put in a suitable IP adress or hostname
>if you are going to run it).
>
>--------------------start---------------------
>#!/usr/local/bin/perl
>
>use Net::FTP;
>
>#-CHANGE THESE VARIABLES TO SUIT YOU-
>$hostname = "Your_IP_Address";
>$loginName = "anonymous";
>$password = "foo\@bar";
>$remoteDir = "/";
>#-CHANGE THESE VARIABLES TO SUIT YOU-
>
>$attemptFtp = 1;
>
>$ftp = Net::FTP->new($hostname);
>if (!$ftp) {
> die "failed to create object, stopped";
>}
>print("created ftp object\n");
>
>getPasswd($attemptFtp, $hostname, $loginName);
>
>
>if (!$ftp->login($loginName, $password)) {
> die "failed to login, stopped";
>}
>print("login successful\n");
>
>if (!$ftp->cwd($remoteDir)) {
> die "failed to cwd, stopped";
>}
>print("cwd succeeded\n");
>
>
>
>
>sub getPasswd {
> my($attempt) = @_[0];
> my($host) = @_[1];
> my($loginName) = @_[2];
> print("[attempt $attempt] enter password for $loginName on $host:");
> #NOTE: THIS 'system' COMMAND WILL APPLY FOR UNIX ONLY
> system "stty -echo";
> $password = <STDIN>;
> #NOTE: THIS 'system' COMMAND WILL APPLY FOR UNIX ONLY
> system "stty echo";
> print("\n");
>}
>
>---------------------end----------------------
>
>
>If I comment out the line:
>getPasswd($attemptFtp, $hostname, $loginName);
>the script executes successfully and $ftp->cwd($remoteDir)
>succeeds.
>
>However if I use that line, it says that $ftp->login is successful
>but $ftp->cwd() fails. Why is that?
>
>Is it that $ftp->login() has really failed even though a success
>is being registered?
>
>Any help would be much appreciated (even an alternative
>method would be nice if you have one).
>
>Thanks very much.
>
>-raj
------------------------------
Date: Wed, 02 Sep 1998 17:17:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Weird problem - can you help?
Message-Id: <Pine.GSO.4.02A.9809021013460.29974-100000@user2.teleport.com>
On Wed, 2 Sep 1998, Raj Subramani wrote:
> Subject: Weird problem - can you help?
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Please look at this ftp script that I wrote:
> #!/usr/local/bin/perl
If you aren't even asking perl to warn you about anything suspicious,
you're not trying hard enough. Do that before you post here. Also, if your
program is longer than about a screenful of text, you should probably
write it with 'use strict'.
BTW, Net::FTP has a debugging mode. Have you tried turning that on? Hope
this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 17:11:43 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Where can I find a Perl script for a non-java, non frames, text/browser based chat room?
Message-Id: <Pine.GSO.4.02A.9809021011260.29974-100000@user2.teleport.com>
On 2 Sep 1998 xx@gte.net wrote:
> Subject: Where can I find a Perl script for a non-java, non frames,
text/browser based chat room?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3619
**************************************