[17519] in Perl-Users-Digest
Perl-Users Digest, Issue: 4939 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 21 09:05:37 2000
Date: Tue, 21 Nov 2000 06:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974815512-v9-i4939@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 21 Nov 2000 Volume: 9 Number: 4939
Today's topics:
[Parse::RecDescent or yacc] question ? raptor555@my-deja.com
Addition vs. concatenation [was: Beginners Blues II] <iltzu@sci.invalid>
Apologies for the excessive reposts! <joe+usenet@sunstarsys.com>
change notify gheiss@my-deja.com
Re: change notify gheiss@my-deja.com
Re: change notify (Tad McClellan)
Re: Closing a window [non flame response :-)] <jodrell@my-deja.com>
Closing a window swilsonnissa@my-deja.com
Re: Closing a window (Michel Dalle)
Re: Closing a window swilsonnissa@my-deja.com
Re: Closing a window <flavell@mail.cern.ch>
Re: Does sub foo { 'A'..'Z' } return a list? <bart.lateur@skynet.be>
Re: Enumerate Existing Modules ? (Tad McClellan)
Eurodate mysteries (Tom Christiansen)
How do I efficiently match many regular expressions at <-@-.com>
Re: How do I efficiently match many regular expressions nobull@mail.com
Re: How do I use Test and Test::Harness? (Garry Williams)
How to decript an encripted password? <duocbtNOSPAM@pacific.net.au>
Re: How to decript an encripted password? <geoff-at-farmline-dot-com@127.0.0.1>
Re: How to decript an encripted password? <bart.lateur@skynet.be>
Re: making a daemon server <bart.lateur@skynet.be>
need for a simple SED-to-PERL translation <-@-.com>
need for a simple SED-to-PERL translation <-@-.com>
Re: need for a simple SED-to-PERL translation (Rafael Garcia-Suarez)
Re: need for a simple SED-to-PERL translation <julien.quint@xrce.xerox.com>
Re: Passing java parameters from Perl <brannon@lnc.usc.edu>
Perl and IIS <cmon_209@hotmail.com>
Perl and IIS <cmon_209@hotmail.com>
Re: Perl and IIS raptor555@my-deja.com
Re: Perl and uploading files... nobull@mail.com
Re: Problem running CGI from HTML <sladb69@magma.ca>
Reg Exp Learning? <webmaster@860.org>
Restrict HTTP daemon to a list of IP addresses (Rafael Garcia-Suarez)
Simple question <ayambema@adelphia.net>
Re: using exec cgi in a perl program <bart.lateur@skynet.be>
Re: Which is the best PERL learning book? <brannon@lnc.usc.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Nov 2000 12:27:47 GMT
From: raptor555@my-deja.com
Subject: [Parse::RecDescent or yacc] question ?
Message-Id: <8vdpnv$atc$1@nnrp1.deja.com>
hi there,
I want to implement grammar that can handle nested<->repeated
structures.(YACC solution are welcome too!)
How can I do it ?
Curently I'm using something like this :
start : 'for' word(s) 'end'
word : ...!'end' ( start | token )
token : /\S+/
So I can parse structure like this :
for
.....
for
.....
end
.....
for
.....
end
end
How to this if I want to add other types of such structures i.e. handle
for example "while" too.
I want to preserve only one END terminator as possible i.e. 'end'
( but not for...endfor, while...endwhile etc....)
Also want to trigger action at every 'start' and 'end'...
Thanx for your help and time.
If you can mail me directly.
iVAN
raptor@unacs.bg
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 21 Nov 2000 14:02:38 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Addition vs. concatenation [was: Beginners Blues II]
Message-Id: <974812727.2114@itz.pp.sci.fi>
In article <8vbjjb$alf$1@soap.pipex.net>, Geoff Winkless wrote:
>"Ilmari Karonen" <iltzu@sci.invalid> wrote in message
>news:974735242.24197@itz.pp.sci.fi...
>>
>> I don't really care, as long as it's associative and commutative like
>> addition is supposed to be.
>
>No. Addition of numbers is associative and commutative.
..and it would make sense to expect anything that is called addition,
or uses the addition operator "+", to follow those laws as well. Of
course you can call anything you want "addition", but if it's nothing
like the regular kind of addition, don't expect your definition to be
considered useful.
>> That might seem like nitpicking, but IMHO it's just plain silly that
>> "$" + 2 + 3 equals "$23" in Java.
>
>What does "$" + (2+3) give?
"$5". Which is more or less my point. In maths, and in just about
any place else where a "+" operator is used, a+b+c equals (a+b)+c
equals a+(b+c). When it doesn't, it's silly and counterintuitive.
Java isn't the worst I've seen, though. There was this one awful
scripting language called Lite, whose designer apparently had decided
that centuries of mathematical tradition had absolutely no relevance
to how arithmetic expressions should be parsed. (In fact, it seems
the guiding design principle for that language was that as long as the
idioms used by the designer worked, there was no reason why the syntax
should allow any kind of generalization.) We finally managed to track
a rather mysterious bug to a routine containing a particular complex
expression: $a = $b+$c*$d, which was being parsed as $a = ($b+$c)*$d.
Just about anyone can see why proper operator precedence is a good
thing. Is is so hard to see why that applies to associativity too?
>> Almost as silly as -5%3 being -2.
>
>Why is -that- silly? In -either- respect, either -(5%3) or (-5)%3 it makes
>perfect sense...
1. Mathematical reason: x%y should equal (x+y)%y for all x and y.
2. Practical reason: It's awkward to write x%y<0?x%y+y:x%y every time
one needs to normalize x to modulo y. Of course, that doesn't
matter much unless one is writing something that involves modular
arithmetic, but if one isn't, then the "%" operator is of limited
usefulness anyway.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clpm
------------------------------
Date: 21 Nov 2000 04:31:45 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Apologies for the excessive reposts!
Message-Id: <m34s11smbi.fsf_-_@mumonkan.sunstarsys.com>
Bart Lateur <bart.lateur@skynet.be> writes:
> Joe Schaefer wrote:
>
> >Yet another repost- my newsfeed is seriously crappy
> >this week. Sorry if was is already posted.
>
> It is. This is the fifth time a variation of this same post appears.
> Warn your ISP. It could be your news server needs some purging (disk
> full).
>
> --
> Bart.
I apologize for all the reposts to the newsgroup- they're
all over one week old and really stale/outdated. My newsfeed
was badly broken last week, and have since changed servers.
Please do me a favor and just ignore them- I thought they were
lost posts, and will try to cancel any that haven't already
been canceled.
Again, my apologies- I won't post again here for at least a
week to let this garbage get cleared out.
--
Joe Schaefer
------------------------------
Date: Tue, 21 Nov 2000 11:29:25 GMT
From: gheiss@my-deja.com
Subject: change notify
Message-Id: <8vdmai$8bi$1@nnrp1.deja.com>
Hi perl freaks,
in perlwin32 there is a change notify for events like a new file is in
the directory.
do anybody know a function like this for unix ?
in this time i look in the directory every hour with the crontab, but i
think this solution is very poor.
greetings from germany
georg
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 12:04:25 GMT
From: gheiss@my-deja.com
Subject: Re: change notify
Message-Id: <8vdoc6$9tk$1@nnrp1.deja.com>
sorry i don't read old answers befor, now i know there is no way on
unix.
In article <8vdmai$8bi$1@nnrp1.deja.com>,
gheiss@my-deja.com wrote:
> Hi perl freaks,
>
> in perlwin32 there is a change notify for events like a new file is in
> the directory.
> do anybody know a function like this for unix ?
>
> in this time i look in the directory every hour with the crontab, but
i
> think this solution is very poor.
>
> greetings from germany
> georg
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 07:03:36 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: change notify
Message-Id: <slrn91kp4o.hka.tadmc@magna.metronet.com>
On Tue, 21 Nov 2000 11:29:25 GMT, gheiss@my-deja.com <gheiss@my-deja.com> wrote:
>Hi perl freaks,
You should as perl freaks Perl questions.
You should ask unix freaks unix questions.
>in perlwin32 there is a change notify for events like a new file is in
>the directory.
>do anybody know a function like this for unix ?
What is your Perl question?
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 21 Nov 2000 13:53:27 GMT
From: Jodrell <jodrell@my-deja.com>
Subject: Re: Closing a window [non flame response :-)]
Message-Id: <8vduok$f0c$1@nnrp1.deja.com>
You seem to have missed a fairly fundamental concept of web design, that
is, of the difference between "client-side" and "server-side" scripting.
> > I have an ASP page that calls a PL page
> > as a separate window.
What you have is some JavaScript embedded into the HTML produced by an
ASP script that opens the URL of a Perl script into a new window.
JavaScript is a "client-side" language, that means it's used by the web
browser to control its behaviour, and various elements on the page.
> > All I was asking was what is the equivalent Perl
> > script command to close a window.
Perl, like ASP, is used on the "server-side" to generate HTML that's
sent to the user. The perl code is executed for the webserver and the
output, a stream of (usually) HTML text is then sent on to the browser.
Therefore perl cannot control the behaviour of the browser, only the
HTML it receives from the server.
To solve this problem, you will need change the Javascript in the HTML
produced by either the ASP script or the perl script so that (1) the
page isn't opened in the first place or (2)there's a link that allows
the window to be closed, as below:
<html>
.
.
.
<p><a href="JavaScript:window.close()">Click here to close this
window.</a></p>
.
.
.
</html>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 09:14:31 GMT
From: swilsonnissa@my-deja.com
Subject: Closing a window
Message-Id: <8vdedl$2vf$1@nnrp1.deja.com>
I can close normal HTML/ASP popup windows with Javascript, but how do I
close a similar Perl script (PL) window.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 11:18:20 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Closing a window
Message-Id: <8vdlqk$k98$2@news.mch.sbs.de>
In article <8vdedl$2vf$1@nnrp1.deja.com>, swilsonnissa@my-deja.com wrote:
>I can close normal HTML/ASP popup windows with Javascript, but how do I
>close a similar Perl script (PL) window.
A similar window, you say ? The same way...
Your browser has no idea whether the HTML code it received was
generated by a Perl script or an ASP page, or whether it came from
some HTML file on the webserver or from a monkey sending back
random characters...
Michel.
------------------------------
Date: Tue, 21 Nov 2000 12:12:30 GMT
From: swilsonnissa@my-deja.com
Subject: Re: Closing a window
Message-Id: <8vdora$abg$1@nnrp1.deja.com>
In article <8vdlqk$k98$2@news.mch.sbs.de>,
michel.dalle@usa.net (Michel Dalle) wrote:
> In article <8vdedl$2vf$1@nnrp1.deja.com>, swilsonnissa@my-deja.com
wrote:
> >I can close normal HTML/ASP popup windows with Javascript, but how do
I
> >close a similar Perl script (PL) window.
>
> A similar window, you say ? The same way...
>
> Your browser has no idea whether the HTML code it received was
> generated by a Perl script or an ASP page, or whether it came from
> some HTML file on the webserver or from a monkey sending back
> random characters...
>
> Michel.
>
Very helpful advice, I must say! I have an ASP page that calls a PL page
as a separate window. All I was asking was what is the equivalent Perl
script command to close a window.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 13:29:50 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Closing a window
Message-Id: <Pine.GHP.4.21.0011211326110.25778-100000@hpplus03.cern.ch>
On Tue, 21 Nov 2000 swilsonnissa@my-deja.com wrote:
[pointlessly comprehensive quote, of which the key part was:]
> > Your browser has no idea whether the HTML code it received was
> > generated by a Perl script or an ASP page,
> Very helpful advice, I must say!
Looks that way to me. Pity you can't use it.
> I have an ASP page that calls a PL page
> as a separate window.
No, you haven't. You have web pages generated in different ways.
The client doesn't know or care how you generated them. They contain
no Perl (a programming language) nor ASP (which is a programming
interface).
> All I was asking was what is the equivalent Perl
> script command to close a window.
This earns you a place in numerous score files, I suspect.
Bye
------------------------------
Date: Tue, 21 Nov 2000 09:01:38 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Does sub foo { 'A'..'Z' } return a list?
Message-Id: <leek1t46tt7tsicsis2028d85pnhijqd8g@4ax.com>
Joe Schaefer wrote:
>Yet another repost- my newsfeed is seriously crappy
>this week. Sorry if was is already posted.
It is. This is the fifth time a variation of this same post appears.
Warn your ISP. It could be your news server needs some purging (disk
full).
--
Bart.
------------------------------
Date: Tue, 21 Nov 2000 07:08:21 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Enumerate Existing Modules ?
Message-Id: <slrn91kpdl.hka.tadmc@magna.metronet.com>
On Tue, 21 Nov 2000 06:24:16 GMT, boomer2000@my-deja.com
<boomer2000@my-deja.com> wrote:
>Is there a way to simply enumerate (list) all of the existing PERL
>modules on a server ?
-------------
#!/usr/bin/perl -w
use strict;
use File::Find;
find( sub { print "$_\n" if /\.pm$/}, @INC );
-------------
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 21 Nov 2000 06:37:30 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Eurodate mysteries
Message-Id: <3a1a7a9a@cs.colorado.edu>
In article <qvo91tsak6ggsnfgrqfpmipkkg8e6he201@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
>># Note my use of European Date format and 4 digit year - just to be
>>different
>
>Not just that. In Europe, we have the habit of putting the day first,
>month second.
Continentals are constantly expressing their confusion, surprise,
and of course, their disapproval, regarding the American habit of
writing dates with the month before the day, as in "11/21" for
today. Having spent five of my last seven weeks traipsing around
the GMT+0 and GMT+1 timezones as something of an itinerant Perl
scholar, I've been called upon to justify this habit time and time
again.
The answer is quite simple: we here in America in our speech would
refer to today as "November twenty-first" (and yes, with ordinals
not with cardinals). Written in full, it might be something like
"October twenty-fourth, nineteen ninety-three". One simply preserves
the order of speech when committing to writing: 10/24/93.
While there are alternate ways of speaking of the date, this first
of these here is by far the most common:
October twenty-fourth, nineteen ninety-three
October twenty-fourth
October the twenty-fourth, nineteen ninety-three
The twenty-fourth of October, nineteen ninety-three
The twenty-fourth day of October, nineteen hundred and ninety-three
I do mean to imply any moral justification here, merely explanation.
A programmer should not feel compelled to present dates to the user
in the same format as the program stores internally. After all,
users don't like 974813192 much. :-)
The ISO date format is nice in many ways. It is not ambiguous, and
it is easy to parse and sort. But it is also not realistic. Once
people start speaking in ISO, then fine, but until then, you can't
expect it of them.
Never store dates meant to be read by computers in localtime()
format; at the very least, use gmtime(). Preferably use something
more readily sortable, like raw time() or the ISO format. But don't
expect people to read that--convert to localtime() upon output only,
just as we convert a numerically-interpreted bit-pattern to something
like "3.14159" on output only.
--tom
------------------------------
Date: Tue, 21 Nov 2000 04:36:50 -0800
From: "Mauro" <-@-.com>
Subject: How do I efficiently match many regular expressions at once?
Message-Id: <8vcqjh$fjc$1@nslave3.tin.it>
Given a string (generally about 20 text chars long), what's the fastest way
to perform a long sequence of complex regexp substitutions where it must
stop on the first one that matches?
thanks
Mauro
------------------------------
Date: 21 Nov 2000 13:01:59 +0000
From: nobull@mail.com
Subject: Re: How do I efficiently match many regular expressions at once?
Message-Id: <u9n1et8omw.fsf@wcl-l.bham.ac.uk>
"Mauro" <-@-.com> trolls:
> Subject: How do I efficiently match many regular expressions at once?
This is not just a FAQ it has been cut and paste word-for-word from
then FAQ.
In another thread the same person asked for help translating sed into
Perl (despite the fact that Perl comes with a sed to Perl translator).
Surely this has to be a troll.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 21 Nov 2000 09:48:52 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: How do I use Test and Test::Harness?
Message-Id: <8yrS5.1245$xb1.77801@eagle.america.net>
On Mon, 20 Nov 2000 15:13:48 GMT, henrik7205@hotmail.com
<henrik7205@hotmail.com> wrote:
>I have some test cases written in perl. Now I'd like adapt them to use
>the Test and Test::Harness modules. I have read the pod's and searched
>for some examples. But I really don't understand how to use the modules.
>
>Can someone post a simple example of a test case written with these
>modules?
use Test::Harness;
@tests = grep { ! /^no-/ } <*.t>;
runtests(@tests);
--
Garry Williams
------------------------------
Date: Tue, 21 Nov 2000 20:35:53 +1000
From: "Duoc B T" <duocbtNOSPAM@pacific.net.au>
Subject: How to decript an encripted password?
Message-Id: <3a1a4db4.e07e0@nancy.pacific.net.au>
hi all,
i would like to validate a user-entered password against an encripted
password that i pull from a database. do i have to decript the encripted
passed and if so, how? these passwords are the same as those in the htpasswd
file that apache uses to authenticate users. basically, i want to do in my
script what apache does. any help is appreciated.
duoc b t
------------------------------
Date: Tue, 21 Nov 2000 10:29:17 -0000
From: "Geoff Winkless" <geoff-at-farmline-dot-com@127.0.0.1>
Subject: Re: How to decript an encripted password?
Message-Id: <8vdipn$9ek$1@soap.pipex.net>
"Duoc B T" <duocbtNOSPAM@pacific.net.au> wrote in message
news:3a1a4db4.e07e0@nancy.pacific.net.au...
> i would like to validate a user-entered password against an encripted
> password that i pull from a database. do i have to decript the encripted
> passed and if so, how? these passwords are the same as those in the
htpasswd
> file that apache uses to authenticate users. basically, i want to do in my
> script what apache does. any help is appreciated.
There is no known way of decrypting a password - it's a one-way algorithm
where some data is lost.
What you do is encrypt the password that the user gives you with the seed
stored in the password file (the first two characters of the "garbage" in
the passwd file is the seed) using crypt. If the crypted password is the
same as the "garbage" then the user entered the correct password, otherwise
he didn't.
Geoff
------------------------------
Date: Tue, 21 Nov 2000 13:10:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to decript an encripted password?
Message-Id: <fisk1t8gspcvj0qm3ek6df8jfnabd7r2dl@4ax.com>
Duoc B T wrote:
>i would like to validate a user-entered password against an encripted
>password that i pull from a database. do i have to decript the encripted
>passed and if so, how?
No you don't. By contrast, you encrypt the password enetered by the
user, and compare that string to the encrypted, stored password.
Since the result of encryption depends on the "salt", you need the salt.
whaddayaknow, that salt is the start of the encrypted string. So:
# demo values
$entered = 'Peekaboo!';
$stored = crypt($entered, 'xq');
# the test:
if(crypt($entered, $stored) eq $stored) {
print "You're in!\n";
} else {
print "Sorry, you can't come in.\n";
}
--
Bart.
------------------------------
Date: Tue, 21 Nov 2000 12:31:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: making a daemon server
Message-Id: <ppqk1ts6srvr9lsfig7snhu0su6lsur53o@4ax.com>
Fran Turgeon Bridges wrote:
>When I
>run it stand alone it runs fine. When I run it as a daemon it does not
>run my system call.
That sounds like a PATH problem.
--
Bart.
------------------------------
Date: Tue, 21 Nov 2000 04:30:18 -0800
From: "Mauro" <-@-.com>
Subject: need for a simple SED-to-PERL translation
Message-Id: <8vcqa7$fhh$1@nslave3.tin.it>
how do I tell PERL to print only matching lines in this sed-like
substitution?
example:
input:
this is a test
the cat eat the mouse
the dog eat the cat
sed -n s/(.*the ).*/\1bone/p
output:
the cat eat the bone
the dog eat the bone
how can I do the same using Perl?
bye
Mauro
------------------------------
Date: Tue, 21 Nov 2000 04:39:03 -0800
From: "Mauro" <-@-.com>
Subject: need for a simple SED-to-PERL translation
Message-Id: <8vcqna$fk1$1@nslave3.tin.it>
how do I tell PERL to print only matching lines in this sed-like
substitution?
example:
input:
this is a test
the cat eat the mouse
the dog eat the cat
sed -n s/(.*the ).*/\1bone/p
output:
the cat eat the bone
the dog eat the bone
how can I do the same using Perl?
bye
Mauro
------------------------------
Date: Tue, 21 Nov 2000 10:25:06 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: need for a simple SED-to-PERL translation
Message-Id: <slrn91kjd5.haq.rgarciasuarez@rafael.kazibao.net>
Mauro wrote in comp.lang.perl.misc:
> how do I tell PERL to print only matching lines in this sed-like
> substitution?
>
> example:
> input:
> this is a test
> the cat eat the mouse
> the dog eat the cat
>
> sed -n s/(.*the ).*/\1bone/p
>
> output:
> the cat eat the bone
> the dog eat the bone
The command-line is :
perl -ne 'print if s/(.*the ).*/$1bone/'
There's a utility, s2p, that comes with perl and that converts sed
scripts to perl scripts. See its manpage.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 21 Nov 2000 11:36:14 +0100
From: Julien Quint <julien.quint@xrce.xerox.com>
Subject: Re: need for a simple SED-to-PERL translation
Message-Id: <thg0kl4noh.fsf@lautaret.grenoble.xrce.xerox.com>
"Mauro" <-@-.com> writes:
> how do I tell PERL to print only matching lines in this sed-like
> substitution?
>
> example:
> input:
> this is a test
> the cat eat the mouse
> the dog eat the cat
>
> sed -n s/(.*the ).*/\1bone/p
>
> output:
> the cat eat the bone
> the dog eat the bone
>
> how can I do the same using Perl?
s/// returns true if a substitution was made. Along with the -n flag, which is
intended for sed users, this gives the following:
perl -ne'print if s/(.*the ).*/$1bone/'
(note also the use of $1 instead of \1.)
--
Julien
------------------------------
Date: Tue, 21 Nov 2000 08:22:06 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Passing java parameters from Perl
Message-Id: <lb7l5xag5t.fsf@lnc.usc.edu>
"Gary L. Berger" <gary.berger@odnss.com> writes:
> I am having a problem passing parameters to java from Perl in a CGI script.
> The quotes are giving me a problem. Any suggestions?
Why dont you join the JPL (java-perl lingo) list? They can help you.
>
>
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
--
Terrence Brannon
------------------------------
Date: Tue, 21 Nov 2000 13:00:01 GMT
From: CM <cmon_209@hotmail.com>
Subject: Perl and IIS
Message-Id: <8vdrkg$c8n$1@nnrp1.deja.com>
Hi.
I am execuring Perl scripts using Perl.exe on my ISS Server.My path to
Perl.exe is C:\Perl\bin\perl.exe.
Is there any other method of running Perl scripts.What is the function
of PerlIS.dll.?Can we execute Perl CGI scripts using PerlIS.dll?
Any help will be appreciated.
Thanks
CM
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 13:00:25 GMT
From: CM <cmon_209@hotmail.com>
Subject: Perl and IIS
Message-Id: <8vdrl6$ca6$1@nnrp1.deja.com>
Hi.
I am executing Perl scripts using Perl.exe on my IIS Server.My path to
Perl.exe is C:\Perl\bin\perl.exe.
Is there any other method of running Perl scripts.What is the function
of PerlIS.dll.?Can we execute Perl CGI scripts using PerlIS.dll?
Any help will be appreciated.
Thanks
CM
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 21 Nov 2000 13:17:30 GMT
From: raptor555@my-deja.com
Subject: Re: Perl and IIS
Message-Id: <8vdsl5$d6t$1@nnrp1.deja.com>
hi,
CHeck the Active State DOC's that comes with dist.
Active Perl FAQ\Windows specifics
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 21 Nov 2000 13:03:17 +0000
From: nobull@mail.com
Subject: Re: Perl and uploading files...
Message-Id: <u9lmud8okq.fsf@wcl-l.bham.ac.uk>
"boxb" <scotto@consultant.com> writes:
> I am somewhat new to perl. I have created a variaty of HTML forms and
> associated perl scripts that allow for me to manage the content and layout
> of a web page by using flat ASCII files and SSI. I want now to add the
> ability to upload images from these forms to my web site. It seemed rather
> simple at first, I just create a form using the <input type="file"
> name="name"> tag and a submit button, right? Not so easy.... How in the
> world do I parse the data? I use a simple subroutine on all my pages to
> parse the incoming data, but it doesn't work on the file I want to upload.
> all it returns is the name of the file I selected to upload.
You can't do HTTP upload unless your from use multipart/form-data. If
you are using the usual cargo-cult "simple subroutine" we usually see
then you can't be using multipart/form-data.
> I've read
> quite a bit on the net about the cgi-pl.lib and CGI.PM, and I've tried to
> implement their solutions to no avail.
(Yawn.) Produce a minimal, compilable, warning-free, strict script that you
believe should work and which doesn't. Post it in _unmodified_
together with the HTML source of a mimimal form. Explain what you
were expecting and what actually happens.
> The tutorials I've seen are too
> high-level for me and assume I know more about perl than I actually do.
Are you sure you are reading the tutorials (i.e. lwpcook) not the
reference manual?
> Anyone can help?
If your problem is that your Perl skills are insufficient to
understand how to use tools like CGI.pm then I recommend you
improve your Perl skills. If you can't use ready-made solutions then
you certainly should not consider trying write a solution from the
ground up. (This is like saying you find modern cars too complex to
understand so you are going to buy some sheet steel and try building a
car instead).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 21 Nov 2000 13:27:57 GMT
From: Scott Thornton <sladb69@magma.ca>
Subject: Re: Problem running CGI from HTML
Message-Id: <3A1A787B.F2399322@magma.ca>
GC wrote:
> Yes, it's OT - SSI but here you go...
What do you mean by OT - SSI?
>
>
> > <HTML><HEAD></HEAD><BODY>
> > Before perl script
> > <!--#exec cgi="/cgi-bin/test2.pl"-->
> > After perl script
> > </BODY></HTML>
>
> <!--#include virtual="cgi-bin/test2.pl"-->
>
What does this include actually do? Does it mean I don't have to enable
SSI? Whats different about it?
>
> rename your .html, .shtml and you're all set. If you can't rename your
> .html .shtml (why??) then use .htaccess:
>
> AddType application/x-httpd-cgi filename.html
>
> HTH
>
> Geoff
Thanks,
Scott
------------------------------
Date: Tue, 21 Nov 2000 09:00:50 -0500
From: "_Thomas" <webmaster@860.org>
Subject: Reg Exp Learning?
Message-Id: <TgvS5.52774$KI6.11526754@typhoon.snet.net>
I'm not new to perl .. but never really understood reg expressions.... does
anybody have any url's, reference material that might make things easier for
me to learn.
I know .. *smack* for never having spent much time on reg expressions, I'm
sorry. ;)
_Thomas
www.860.org
webmaster@860.org
------------------------------
Date: Tue, 21 Nov 2000 08:51:06 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Restrict HTTP daemon to a list of IP addresses
Message-Id: <slrn91kdst.gsf.rgarciasuarez@rafael.kazibao.net>
I'm writing a small HTTP daemon using the HTTP::Daemon class. I want to
know what is the preferred way to restrict it to accept connections only
from a specified list of IP addresses (e.g. 127.0.0.1 and 1.2.3.*).
Is the following code correct?
while (my $c = $daemon->accept) {
if ($c->peerhost !~ /^(127\.0\.0\.1|1\.2\.3\.\d+)$/) {
close $c; next;
}
# Handle connection...
}
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Tue, 21 Nov 2000 13:53:25 GMT
From: "hokiebear" <ayambema@adelphia.net>
Subject: Simple question
Message-Id: <p7vS5.2043$tR2.59281@news1.news.adelphia.net>
I have the code fragment below and it is driving me crazy. Why is it that
when &Test2 is called it prints "The cost is 35" and not "The cost is 40"?
Thank you.
#____________________________________________________
my $Cost=35;
&oneRoutine($Selection);
#_____________________________________________________
sub oneRoutine {
if ($Selection eq "Green", "Blue", "Black") {
&Test1($Cost);
}
elsif ($Selection eq "Red") {
&Test2($Cost);
}
}
#_________________________________________________________
sub Test1{
print "The cost is $Cost";
}
#_________________________________________________________
sub Test2{
$Cost=$Cost + 5;
print "The cost is $Cost";
}
------------------------------
Date: Tue, 21 Nov 2000 12:52:36 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: using exec cgi in a perl program
Message-Id: <ourk1ts9sll8gfotuplcqo4h6j5lt8mqro@4ax.com>
u0107@cheerful.com wrote:
>the
>URL reads something like:
>
>http://www.mysite.com/cgi-bin/myperl.pl?parameter_1=xxx
>
>myperl.pl uses the value of parameter_1 and generates html code based
>on the value.
>
>In the generated html code I need to use exec cgi.
You can't mix CGI (in perl) with SSI. These are competing technologies.
Can't you just do the equivalent of the "EXEC CGI" and incorporate the
result in what perl prints out?
--
Bart.
------------------------------
Date: Tue, 21 Nov 2000 08:18:49 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Which is the best PERL learning book?
Message-Id: <lbbsv9agba.fsf@lnc.usc.edu>
mjd@plover.com (Mark-Jason Dominus) writes:
> I got Wrox to send me a copy, and I'm afraid I didn't really think
> much of it. It is another very large, thick book, which, despite its
That's a shame. Simon's tutorials on PERLARCHIVE.com are excellent. He
did a wonderful job of introducing both grep and map and I was able to
put his instruction to use in my daily work immediately.
--
Terrence Brannon
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 4939
**************************************