[8269] in Perl-Users-Digest
Perl-Users Digest, Issue: 1886 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 13 08:08:58 1998
Date: Fri, 13 Feb 98 05:00:49 -0800
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, 13 Feb 1998 Volume: 8 Number: 1886
Today's topics:
Another disappointing Perl book <joseph@5sigma.com>
Re: Date validation (Steffen Beyer)
DOCUMENT-URI and Apache SSI? <jbb@ipc.co.uk>
Re: FAQless Forays (was: Code Example Needed) (Bart Lateur)
Re: hexadecimal to binary conversion? <lpeters@aol.net>
how to get back Filename from FILEHANDLE ?! <vlierd@uni-oldenburg.de>
Re: Killfile Triage (Seymour J.)
Learning Perl (James L. Taylor)
Re: Learning Perl <friedman@uci.edu>
Re: Learning Perl <ajohnson@gpu.srv.ualberta.ca>
Re: Oh, Yeah - those pesky cr's! (Bart Lateur)
Re: on reading FAQs and gurus answering questions <merlyn@stonehenge.com>
Re: on reading FAQs and gurus answering questions (Bart Lateur)
Re: on reading FAQs and gurus answering questions <joseph@5sigma.com>
Open Remore File (Bruce Davidson)
Re: Periodically check for lost-carrier (NT4) <jaybird612@prodigy.net>
Re: perl -e in Win95? (Ed Avis)
Perl 5 for Win32 Q: How can I determine how a script wa <lomax_nt@paranor.ch>
perl NT : how get %env of a remote host ? <denis@swisslife.be>
Re: Perl use on IIS 4 (Thomas L. Shinnick)
Re: RFC about ``Matt's Script Archive'' (Bart Lateur)
Syntax question (Helmut Jarausch)
Testing integer <brezing@gia.rwth-aachen.de>
Re: Testing integer <joseph@5sigma.com>
The FAQ problem and three suggestions <tom@moertel.com>
Re: Why is Tom Christiansen so rude? (Steffen Beyer)
Re: Zero-width positive lookahead assertion Q (Sitaram Chamarty)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 13 Feb 1998 01:43:56 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Another disappointing Perl book
Message-Id: <34E40773.FBA6605E@5sigma.com>
Every so often I take time to look over a new Perl or Perl/CGI
book in the bookstore. I used to make the mistake of buying them,
then looking them over :-( but I don't do that anymore ...
So, the newest victim was the Sybex Perl CGI Programming: No
Experience required, which several "reviewers" raved about on
the Amazon page. Umm hmm.
Well, the book is all Perl 4 so far as I could determine from a
5-10 minute inspection. There is a section that discusses
the "elseif" statement. That's right, "elseif". It's very
consistent in that spelling. And then in the beginning there's
a lot of code like
print "Foo", $a, "Bar", "\n";
I kid you not.
Since I didn't read this book that closely, I won't officially trash
it, but it didn't pass my "laugh test."
-joseph
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 12 Feb 1998 21:49:38 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Date validation
Message-Id: <6bvqpi$gi9$2@en1.engelschall.com>
Stan Horwitz <stan@thunder.temple.edu> wrote:
> I am trying to write a date validation routine in Perl on a Unix box. The
> date is to be entered on a terminal in response to a prompt. The date is
> stored as a string in the format mm/dd/yyyy. When I try to make sure that
> "mm" is in the range 01 to 12, I run into a problem, perhaps the result of
> my being somewhat inexperienced at Perl programming.
> Here's what I came up with:
[...]
> Any suggestions you may have will be appreciated.
You might want to check the "Date" modules on CPAN, because these modules
offer date extraction and validation, which could assist you in your task.
These modules also validate the number of days in leap years very nicely.
Check out http://www.perl.com/CPAN/modules/by-module/Date/
or http://www.perl.com/CPAN/authors/id/STBEY/
or http://www.engelschall.com/u/sb/download/
Hope this helps.
Yours,
--
Steffen Beyer <sb@sdm.de>
Feel free to visit my download area with free software at
http://www.de.engelschall.com/u/sb/download/ or
http://www.ch.engelschall.com/u/sb/download/
------------------------------
Date: Fri, 13 Feb 1998 12:30:34 -0000
From: "ybw" <jbb@ipc.co.uk>
Subject: DOCUMENT-URI and Apache SSI?
Message-Id: <887373243.18005.0.nnrp-05.9e98c68d@news.demon.co.uk>
I'm trying to get a little script to work with Apache's SSI capability, but
it's not working. I can sucessfully play scripts with the standard "exec cgi
" SSI command in a web page, but this one just doesn't output anything.
It plays OK from the command line, although -w complains of an
"uninitialized value" on the "if ($url =~ '/admin/table.htm') {" line.
What I'm beginning to think is maybe Apache won't let me use DOCUMENT_URI
like this. Any ideas would be much appreciated.
#!/usr/local/bin/perl
$url = $ENV{'DOCUMENT_URI'}; # What's the URL?
if ($url =~ '/admin/table.htm') {
print "You're looking at table.htm\n";
} else {
print "You're looking at another page.\n\n";
}
JJ
------------------------------
Date: Fri, 13 Feb 1998 10:30:09 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <34e502b8.3264632@news.tornado.be>
? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
wrote:
>>Oh, come on. I post from a PC. It just happens to be running
>>FreeBSD, and has about 10 users. PC user != idiot.
>
>If it has more then one user then it is not a PC.
How do you manage with the keyboard then? <GRIN>
Honostly, many full blown respectable software developers program on
their private Unix workstation. Which is then, by your definition, a PC.
So these people are dumb?
Bart.
------------------------------
Date: Fri, 13 Feb 1998 05:18:25 -0500
From: Les Peters <lpeters@aol.net>
Subject: Re: hexadecimal to binary conversion?
Message-Id: <34E41DF1.3BD2@aol.net>
eric_gutt@mentorg.com wrote:
>
> What's a clever way to convert a hexadecimal string of
> any (reasonable) length to binary? Or am I just not
> seeing the %b format for sprintf? Examples:
> "1ab3" -> 0001101010110011
> "1" -> 0001
> "cc" -> 11001100
>
> I've done it in about 50 lines of Perl, but that seems like way
> too much code.
How about this:
my ($vec, @bits);
my ($bin) = "";
my ($hex) = "1ab3";
for (split(//,$hex)) {
vec($vec, 0, 4) = hex;
$bin .= join("", reverse split(//,unpack("b4",$vec)));
}
print "$bin\n";
Les
------------------------------
Date: Fri, 13 Feb 1998 13:38:07 +0100
From: Claus van de Vlierd <vlierd@uni-oldenburg.de>
Subject: how to get back Filename from FILEHANDLE ?!
Message-Id: <34E43EAE.79558729@uni-oldenburg.de>
If i am doing something like
$FH="FH00";
open($FH,"/tmp/xxx");
--- how can I , later on , from the sheer knowledge of
the Filehandle FH00 regain the name of my File ("/tmp/xxx")
to which it is referring after the "open" ?!?
regards ,
Claus van de Vlierd
------------------------------
Date: Wed, 11 Feb 98 08:12:19 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org>
Subject: Re: Killfile Triage
Message-Id: <34e1a3b3$1$fuzhry$mr2ice@news1.mnsinc.com>
In <6bnv7o$n1g$1@csnews.cs.colorado.edu>, on 02/09/1998
at 10:16 PM, Tom Christiansen <tchrist@mox.perl.com> said:
>The last directive in the following group
>destroys any postings related to spam in any fashion. In particular,
>this is to get rid of postings by people who like to put quirky "nospam"
>gimmicks in their addresses, making it difficult to contact these people.
>Let them eat /dev/null! Such "From" lines are not just a pain in the
>butt; they are also not legal, and I zap illegal messages.
Sigh! Good advice costs nothing and it's worth the price. The presence of
"nospam" in an address does not mean that it is munged, that it is illegal
or even that it is undeliverable. Anyone with half a clue would recognize
that this filter will hit valid addresses as well as the invalid ones.
Bottom line: do your own research on the consequences of a filter; don't
just rely on the author.
--
-----------------------------------------------------------
Shmuel (Seymour J.) Metz, SysProg and JOAT
Atid/2
Team OS/2
Team PL/I
Any unsolicited commercial junk E-mail will be subject to legal action. I
reserve the right to publicly post or ridicule any abusive E-mail.
I mangled my E-mail address to foil automated spammers; reply to domain
acm dot org user shmuel to contact me. Do not reply to
spamtrap@library.lspace.org
-----------------------------------------------------------
------------------------------
Date: Fri, 13 Feb 1998 08:17:02 GMT
From: cowboy@cnnw.net (James L. Taylor)
Subject: Learning Perl
Message-Id: <34e3fe9c.9914092@news.cnnw.net>
Hi All,
Hope someone can help me with a question that I'm having about the
book "Learning Perl" on pages 20-21 it is dealing with WORDSLIST a
seperate file from the guess script. On page 20 it says:
The 'while' loop reads lines from the 'wordslist' file (via the
WORDSLIST filehandle) one line at a time..etc.
Then it goes on to say that the guess script will read the first line
then the second line within the wordslist file...
my question is why doesn't it work?? I have the script written just
like the book shows...I have the wordslist in the same directory, and
it is written just like the book too.
When I type fred in and then type in the password that fred is suppose
to have...I get "wrong try again" then I have to type groucho (the
secret word for everyone) to exit the program??
Here is what I have and I have compared it to the book several times,
some of the print statements are a little different but as far as the
rest of the script I made sure everything was by the book...can
someone help me?
#!/usr/bin/perl
&init_words;
print "What is your name? ";
$name = <STDIN>;
chop($name);
if ($name =~ /^randal\b/i) {
print "Hello Randal, how are you?\n";
}else{
print "Hello $name\n";
print "What is the secret word? ";
$guess = <STDIN>;
chop($guess);
while (! &good_word($name,$guess)) {
print "Wrong try again. What's the secret word?";
$guess = <STDIN>;
chop($guess);
}
}
sub init_words {
open(WORDSLIST, "wordslist.pl"); # I have this named wordslist &
wordslist.pl
while (%name = <WORDSLIST>) {
chop($name);
$word = <WORDSLIST>;
chop($word);
$words{$name} = $word;
}
close(WORDSLIST);
}
sub good_word {
local ($somename,$someguess) = @_;
$somename =~ s/\W.*//;
$somename =~ tr/A-Z/a-z/;
if ($somename eq "randal") {
1;
} elsif (($words{$somename} || "groucho") eq $someguess) {
1;
} else {
0;
}
}
James L. Taylor
www.bannerfx.com
------------------------------
Date: 13 Feb 1998 08:26:42 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Learning Perl
Message-Id: <6c1042$q5s@news.service.uci.edu>
In article <34e3fe9c.9914092@news.cnnw.net>,
James L. Taylor <cowboy@cnnw.net> wrote:
<sub init_words {
<open(WORDSLIST, "wordslist.pl"); # I have this named wordslist &
does "Learning Perl" really have an open() without the
accompanying check for an error?
You should always write open() this way:
open WORDLIST, "<wordlist" || die "Can't open wordlist: $!";
(note the chance of the filename: you're opening your program source
and not the datafile)
--
Eric D. Friedman
friedman@uci.edu
------------------------------
Date: Fri, 13 Feb 1998 03:04:01 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Learning Perl
Message-Id: <34E40C81.15B42455@gpu.srv.ualberta.ca>
James L. Taylor wrote:
!
[snip]
! Here is what I have and I have compared it to the book several times,
! some of the print statements are a little different but as far as the
! rest of the script I made sure everything was by the book...can
! someone help me?
!
[snip, non-indented code]
! sub init_words {
! open(WORDSLIST, "wordslist.pl"); # I have this named wordslist &
! wordslist.pl
! while (%name = <WORDSLIST>) {
^
you want $name here.
regards
andrew
------------------------------
Date: Fri, 13 Feb 1998 10:30:11 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Oh, Yeah - those pesky cr's!
Message-Id: <34ee1f46.10574161@news.tornado.be>
Rich Grise <lovegod@earthling.net> wrote:
>So far, what seems to work for me is
>$input =~ s/\r*\n//g;
>
>I don't know if that's "right" or not, but it works for me!
You're doing some "smart chomp", removing all kinds of newlines. Is that
what you really want? If so, you may also try out the following syntax,
which approximately does the same, but is a bit more flexible in what it
accepts, and probably is somwhat faster:
tr/\n\r//d;
The "right thing" would be to use the Ascii code, I'd think. Except on
EBCDIC.
tr/\x0A\x0D//d;
Bart.
------------------------------
Date: 13 Feb 1998 01:11:40 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: nathan@ncyoung.com
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <8clnvf7wlf.fsf@gadget.cscaper.com>
>>>>> "Nathan" == Nathan Young <nyoung@silcom.com> writes:
Nathan> If you read all the documentation, think about things
Nathan> carefully, and play around a bunch, you should be able to
Nathan> answer any question yourself. Practicality aside, if everyone
Nathan> did that there would be no newsgroup.
Completely false.
I myself post questions here. And I have read the documentation.
Heck, I *wrote* the documentation. And I hack Perl 4-12 hours a day.
"Does anyone here have experience with getting Perl to compile on
Solaris 2.6 with gcc?" is a mighty fine question if it's not a FAQ.[1]
And it's the kind of thing that a user community can provide support
for, in a nice way.
As long as it's not drowned out by FAQs. That's the problem. FAQs
and mispostings.
In the old days, we used to get chunks of source shared as well: "hey
look at this nifty recursive directory tree walker[2] I
wrote". *There's* community for you.
Think "potluck". I'm rather pleased with myself on the analogy there.
I'm just looking for a bigger potluck, where *everyone* realizes that
it's not a gravy train. And people *bring* stuff when they can... not
just take -- take -- take. Why is that so hard to wish for? What
makes it so easy for people to get into the "helpdesk" mentality when
they push that big "POST" button on Netscape?
I wouldn't mind 500 posts a day here -- *if* I could guarantee that
*none* of them had an approximate or exact answer in the FAQ. And
none of them should have been posted to ciwac instead. I could then
pick the 10 most interesting problems, solve them, and be happy. And
Tom Phoenix could pick the other 490 most interesting problems, and
solve them, signing each with "Hope this Helps!". :-)
[1] it's actually a FAQ, and the answer is "you have to patch gcc to
get it to compile much of *anything* in 2.6, and the patch is in the
Solaris FAQ".
[2] of course, these days, it's just "use File::Find" :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 200 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 13 Feb 1998 10:29:37 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <34f02074.10876742@news.tornado.be>
Randal Schwartz <merlyn@stonehenge.com> wrote:
>It's my impression that this group is populated with:
>
> 20% FAQs
> 20% answers to above telling them to read the FAQ/manual/etc
> 20% stuff that should have been asked in ciwa.cgi or ciwa.html
> 20% answers to above telling them to go to ciwac or ciwah
> 10% *interesting stuff* -- well formed questions that aren't FAQs
>
>I'm sorry. I don't get enough time to clearly locate that last 10%.
That's only 90%. But that's probably "unclassified stuff".
>It really means this group has gotten to be next-to-useless.
>
>I think for me it means more the passing of an era. When people
>*used* to understand that Usenet was more than a "help desk". That
>"give a little, get a little" was the norm, instead of the exception.
I think Usenet should *also* be a helpdesk. For the right questions.
>But I wax nostalgic.
Just imagine what impression people that are relatively new to Perl and
to this newsgroup must be getting. 40% of the posts (according to
Randal's figures) are fames to newbies for (a) asking FAQ's and (b)
posting in the wrong newsgroup.
We must look just like a bunch of old grumpy farts.
Just let it be. Flaming newbies doesn't help. Do some statistics on this
group, and you're likely to find that it's not the same people asking
the stupid questions over and over again. They're *different* people.
And there will always be other newbies.
Please restrict the "rude" replies to e-mail only. When publicly posted,
they're quite useless anyway. Only those people who also don't include a
valid reply address ought to be tackled in public. That leaves... still
quite a lot. Hmm.
Bart.
-
'D*mn!', said Carrot, a difficult linguistic feat.
-- Terry Pratchett, "Feet of Clay"
------------------------------
Date: Fri, 13 Feb 1998 05:31:54 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <34E43CDA.B2B8CBFE@5sigma.com>
A moderated group would be welcomed, I think.
-joseph
Randal Schwartz wrote:
>
> I used to answer about 5 to 30 messages a day in clpm. If you've
> noticed, I don't any more.
>
> I pull up the daily postings, see 200 messages, and it's all I can do
> just to quickly scan through them before I have to run off to do the
> day's activities.
>
> It's my impression that this group is populated with:
>
> 20% FAQs
> 20% answers to above telling them to read the FAQ/manual/etc
> 20% stuff that should have been asked in ciwa.cgi or ciwa.html
> 20% answers to above telling them to go to ciwac or ciwah
> 10% *interesting stuff* -- well formed questions that aren't FAQs
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: Fri, 13 Feb 1998 10:16:21 GMT
From: bruce@allied.demon.co.uk (Bruce Davidson)
Subject: Open Remore File
Message-Id: <887365240.2983.0.nnrp-01.9e982204@news.demon.co.uk>
Hi,
I use this to open a header file in my server path and buiild the perl
generated page from it.
sub print_header {
print "Content-type: text/html\n\n";
open (HEADER,"$ext/$header") || print "Could not
open $ext/$header $! \n"; while (<HEADER>) { print
$_;
}
close(HEADER);
I want to open a header on another server instead.
Can anyone give a correction to the above to allow
opening of remote header.
Thks
bruce@allied.demon.co.uk
------------------------------
Date: Fri, 13 Feb 1998 12:45:29 +0000
From: jay <jaybird612@prodigy.net>
Subject: Re: Periodically check for lost-carrier (NT4)
Message-Id: <34E44069.5A7B4106@prodigy.net>
Martien Verbruggen wrote:
> In article <6brqn5$2sm2$1@newssvr08-int.news.prodigy.com>,
> "Jay J" <jaybird612@frootloops.prodigy.net> writes:
> > Unfortunately I'm having difficulties getting Apache (RH5 Build) to allow me
> > to run CGI, so I opted to install Omni HTTPd for NT after a revelation from
> > a NG post that said Perl would read output from an HTML form as <STDOUT>.
>
> Huh? perl won't read from STDOUT. perl can read from STDIN, but that
> has nothing to do with web servers or HTML forms.
You're right, and STDIN is what I meant to say - but how does using Perl as a CGI
to read output of a form, *not have anything to do with web-servers?At any rate -
I've upgraded Apache and solved my CGI question.
> [Snip of stuff about NT 'system' calls, current IP addresses, and
> modem stuff]
> > Any ideas?
> If you are looking for ways to get your IP address in perl, have a
> look at the Net:: modules, and gethostbyname (think 'localhost')
>
> If you are looking for modem stuff: Have a look at CPAN
> (http://www.perl.com/CPAN/). If there is anything out here to do
> that, it should be there.
Thanks, and I will.
> To run things periodically, you'll have to choose some NT specific
> tool to do that.
Actually, I guess what I'm trying to avoid is using a script that's always*
checking something (i.e. time, carrier), almost like a wait(10,minutes); kind of
thing.
> > p.s. anyone who takes pity on me for my problems w/Apache, free advice is
> > gladly accepted...
>
> You should really take that discussion to the webservers newsgroups.
> They'll most likely glady answer your questions.
>
> comp.infosystems.www.servers.ms-windows
I didn't intend to hold a discussion here, but thanks I will check out
comp.infosystems.www.servers.unix
------------------------------
Date: Fri, 13 Feb 1998 11:42:40 GMT
From: epa@datcon.co.uk (Ed Avis)
Subject: Re: perl -e in Win95?
Message-Id: <34e42fd8.264859758@news-direct>
On 13 Feb 1998 04:07:25 GMT, lethr@dont.spam.the.net (lethr) wrote:
>Does anyone know if the perl -e (not working) is being addressed/resolved?
>Is there an alternate? Here's what I get:
>
>C:\perl.scripts>perl -e 'print "Hello\n;"'
>Can't find string terminator "'" anywhere before EOF at -e line 1.
That's not a problem with perl, it's because command.com doesn't
recognize ' as being the start/end of a quoted string.
On NT, the quoting rules aren't quite as bad, and you can do
perl -e "print \"Hello\n\";"
but I'm not sure this works with command.com.
You could get a port of bash to Win32
<http://www.cygnus.com/gnu-win32/index.html> and use that.
--
Ed Avis
------------------------------
Date: Fri, 13 Feb 1998 11:10:06 +0100
From: "Keith Lomax" <lomax_nt@paranor.ch>
Subject: Perl 5 for Win32 Q: How can I determine how a script was executed?
Message-Id: <6c160q$ous$1@ubnnews.unisource.ch>
I have searched the FAQ and the books, but I can not find out how to do the
following:
I have a Perl script, which may be invoked in two ways:
1. using the usual command line within a console window
2. by double-clicking on the file in the Explorer window.
If the script is invoked from Explorer, it will create a console for its own
use. I want this console to stay open until the user explicitly closes it;
otherwise the user does not have the time to read the output.
As a simple solution, I pass an option to the script, which causes the
script to wait for the user to press a key. I can do this by changing the
file association so that the double-click appends the above option, but I
would rather handle this issue within Perl.
Is there a more elegant solution for determining how a Perl script was
invoked in WinNT?
Thanks,
Keith Lomax
(Direct replies would be appreciated keith@lomax.org)
------------------------------
Date: Fri, 13 Feb 1998 12:02:58 +0100
From: denis <denis@swisslife.be>
Subject: perl NT : how get %env of a remote host ?
Message-Id: <34E42861.76540526@swisslife.be>
With perl under NT, we try to get the %env of a remote host.
Does anybody know how to proceed ?
Thanks.
e-mail: Giancarlo.Anastasia@swisslife.be
------------------------------
Date: Fri, 13 Feb 1998 08:33:17 GMT
From: tshinnic@io.com.mapSoN (Thomas L. Shinnick)
Subject: Re: Perl use on IIS 4
Message-Id: <34e3fe22.34268976@news.io.com>
By "added the string value .... to the registry," I assume
you mean using regedit to locate
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
W3SVC\Parameters\ScriptMap
and adding REG_SZ value so that the result list item is (e.g.)
.cgi M:\Perl\bin\perl.exe %s %s
and then restarting the IIS WWW service?
As for SSI, that means you changed the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
W3SVC\Parameters
value ServerSideIncludesExtension to ".cgi" from the default
".stm", and checked that value ServerSideIncludesEnabled was
set to 1?
Oh, and making sure the script is in one of the configured
virtual dirctories, and that the directory has execute
privilege?
But then again, I'm using PWS 3.0. Please tell us how this
is resolved, so I can make plans to/not to upgrade...
On Thu, 12 Feb 1998 22:00:55 -0500, "Ted Thomas" <tthomas@netacc.net> wrote:
>I have been unable to get the PWS version of IIS 4, running on a standalone
>NT 4 workstation, to run Perl cgi scripts. They either result in the error
>message "%1 is not a valid Windows NT command" or, in the case of SSI
>scripts, they are ignored. I added the string value
>"e:\ntreskit\perl\perl.exe %s %s" with key ".cgi" to the registry, but this
>made no difference.
------------------------------
Date: Fri, 13 Feb 1998 10:30:01 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <34ef2004.10764750@news.tornado.be>
Steve Palincsar <palincss@nicom.com> wrote:
>Further commentary: it doesn't take all that long to rewrite the
>offending routines and add flocking as required. Why, oh why
>has Matt not done that yet?
Probably because it hasn't bitten him yet. It would only do that on a
reasonably busy site.
Bart.
------------------------------
Date: 13 Feb 1998 12:25:52 GMT
From: jarausch@numa1.igpm.rwth-aachen.de (Helmut Jarausch)
Subject: Syntax question
Message-Id: <6c1e4g$p97$1@nets3.rz.RWTH-Aachen.DE>
Hi,
can anybody explain what is going on if I say
print STDERR ("something went wrong\n"), exit if 2 > 1;
Here I don't see anything printed. Exit seems to be so fast,
that some buffers (although STDERR isn't buffered) are lost.
One more problem for today,
perldoc says
If there is a syntax error or runtime error, or a die() statement is
executed, an undefined value is returned by eval()
This seems to imply that it doesn't return UNDEF if there are no errors,
but...
use strict;
use subs qw/OK/;
my $C = 2;
my $X;
defined(eval <<"EOS") or die "eval failed $@";
sub OK
{ return \$X <= $C; }
EOS
is always saying that eval failed.
Thanks for your explanation,
Helmut.
--
Helmut Jarausch
Lehrstuhl f. Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany
------------------------------
Date: Fri, 13 Feb 1998 10:04:46 +0100
From: Andy Brezing <brezing@gia.rwth-aachen.de>
Subject: Testing integer
Message-Id: <34E40CAE.41C6@gia.rwth-aachen.de>
Hi
I'm a Perl beginner and need some some help in the distinction of data
types.
Question: How can I test a variable whether it's an integer or not,
the variable value could be any data-type (string,number,list ...)
I've tried to do it this way, but it didn't work:
print "$i not an number \n" unless /^\d+$i/;
Are there any build-in functions or subroutines for testing numbers,
strings.... ?
Thanks in advance.
Cheers
Andy
**** E-MAIL: brezing@gia.rwth-aachen.de
------------------------------
Date: Fri, 13 Feb 1998 05:22:14 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Testing integer
Message-Id: <34E43A97.18A03C71@5sigma.com>
int($a) == $a, perhaps
-joseph
Andy Brezing wrote:
>
> Hi
>
> I'm a Perl beginner and need some some help in the distinction of data
> types.
>
> Question: How can I test a variable whether it's an integer or not,
> the variable value could be any data-type (string,number,list ...)
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: Fri, 13 Feb 1998 02:07:06 -0500
From: "Tom Moertel" <tom@moertel.com>
Subject: The FAQ problem and three suggestions
Message-Id: <6c0req$jqv$1@banyan.moertel.com>
I dearly love Perl, and I say that as I guy who loves Unix. When I first
used Perl, not too long ago, I got that warm Unixy feeling -- you know, that
feeling you got when you first tried fork(2), or got a couple of processes
chatting across a pipe, or saw your own little program coax twinkling stars
out of a vt220. There's something about moments like those that make you
glad you're a programmer. And, for me, using Perl for the first time was one
of those moments. So, let me be clear: I love Perl, and I love Unix.
Nevertheless, I can't help but notice that times are changing. There are
tons of new programmers out there. Most of them don't know anything about
Unix. They'll probably never use it, and that's a shame.
But they *can* use Perl, and I think that we ought to do everything
reasonably possible not to dissuade them from doing so. Sure, they can be
lazy at times -- even rude. And certainly the group's signal-to-noise ratio
has dropped precipitously in recent months. But, still, we ought to be true
to what we believe, and that means we ought to help these guys use Perl.
The perlfaq, despite being a richly packed gold mine of help, doesn't seem
to be helping enough. There's a large number of people who find it easier to
get answers by posting to c.l.p.m than by mining the perlfaq. Until we
change the situation, we can expect the S/N ratio to remain low.
So, what can we do? Here are a few ideas:
First, we ought to make it easy to get to the perlfaq. If you cite the
perlfaq, include a URL. URL's are easy to use and provide instant
gratification. E.g.:
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq.html
Who knows, after people visit it a few times, they might try the perlfaq
*before* posting.
Second, we ought to teach people how to answer their own questions. In other
words, when you respond to a question, show a complete solution and show how
you arrived at it. Let readers learn perlthink and the process of answering
questions about Perl. Don't leave exercises for the reader, no matter how
tempting, because only the person who asked the original question has
incentive to work through the exercise. The hundred other newbies who read
your reply will simply move on, having learned nothing about the perl way of
thinking or about how easy it is to find answers in the perlfaq.
Third, we ought to be nice. Always. It's difficult, and often unsatisfying,
but being nice is something we must master if we're to persuade readers that
learning to use the perlfaq is a wise investment of their time and effort.
Well, that's it, my $0.03: Make it easy to get to the perlfaq. Teach people
how to answer their own questions. And be nice, always.
Try 'em.
Cheers,
Tom
------------------------------
Date: 13 Feb 1998 07:42:56 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: Why is Tom Christiansen so rude?
Message-Id: <6c0ti0$5lk$1@en1.engelschall.com>
Kent Perrier <kperrier@Starbase.NeoSoft.COM> wrote:
> Gellyfish@btinternet.com (Jonathan Stowe) writes:
>> In article <6bv95t$ira$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com
>> says...
>>
>> >For this, Ken invented grep.
>> >
>>
>> This probably is not why Bill G. "invented" the happless find though ;-{
>>
> But the FSF has provided a functional equivalent of the unix grep for
> Bill'$ broken OS.
> Kent
Unfortunately, beginners and poor PC owners might not be aware of that... :-)
Yours,
--
Steffen Beyer <sb@sdm.de>
Feel free to visit my download area with free software at
http://www.de.engelschall.com/u/sb/download/ or
http://www.ch.engelschall.com/u/sb/download/
------------------------------
Date: 13 Feb 1998 09:31:51 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Zero-width positive lookahead assertion Q
Message-Id: <slrn6e7trm.er5.sitaram@ltusitaram.diac.com>
On Thu, 12 Feb 1998 16:26:36 GMT, David Griffin <griffin@i33.com> wrote:
>I'm trying to add commas to long numbers, eg, 1234123545 becomes
>1,234,123,545. It seems to me that this should do the trick:
>
>$num =~ s/(\d{1,3})(\d{3})(?=\d{3})*$/\1,\2/g;
I'm not really sure the "*" (match >= 0 times) quantifier is
applicable to lookahead assertions...that's prolly your trouble.
(Also - it's called *zero* width. So however many of those you
have is the same as just having one - perverse logic, but hey I've
convinced myself :-)
Someone will correct me if I'm wrong - I hope!
------------------------------
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 1886
**************************************