[12514] in Perl-Users-Digest
Perl-Users Digest, Issue: 6114 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 24 02:07:14 1999
Date: Wed, 23 Jun 99 23:00:18 -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, 23 Jun 1999 Volume: 8 Number: 6114
Today's topics:
Re: 'Perl core' or 'perl core'? <wyzelli@yahoo.com>
Re: 2 simple (not to me tho) questions <dgris@moiraine.dimensional.com>
Re: _Please_ improve localtime! <Russell_Schulz@locutus.ofB.ORG>
Re: A foreach question <cassell@mail.cor.epa.gov>
Re: Can I do this? Conditional Operator construct.... (Ronald J Kimball)
Re: Continuing fun with Hash or Lists... (Martien Verbruggen)
Re: Displaying Adds (Ronald J Kimball)
Re: Does Perl have a future? <webmaster@chatbase.com>
foo, backtick, and others <ranaylor@cais.net>
Re: global vars <cassell@mail.cor.epa.gov>
Re: HELP: Can't delete ONE stinking file with Unlink! (Ronald J Kimball)
Intelligent case conversion? (eg., Title Case) (Lee Borkman)
Re: Losing Date/Time Information from Oracle Database ()
Re: Losing Date/Time Information from Oracle Database (Lee Borkman)
Network admin <gio98dr@yahoo.com>
Re: Perl Alphanumeric Sort? (Martien Verbruggen)
Re: Perl and Personal Web Server (Win98) tedd_scofield@my-deja.com
Re: Perl in Win32 <jlauber@execpc.com>
Re: Perl<-->Mail Server on NT <cassell@mail.cor.epa.gov>
Re: Referencing question, was: "Re: use strict question (Eric Bohlman)
Repettive Text manipulation <tvalis@intur.net>
Re: Repettive Text manipulation (Eric Bohlman)
Re: suid problem with perl (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 24 Jun 1999 15:02:02 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: 'Perl core' or 'perl core'?
Message-Id: <bpjc3.588$x9.26332@vic.nntp.telstra.net>
Abigail <abigail@delanet.com> wrote in message
news:slrn7mq84r.k1b.abigail@alexandra.delanet.com...
> Wyzelli (wyzelli@yahoo.com) wrote on MMCXIX September MCMXCIII in
> <URL:news:tx0b3.114$E4.55726@vic.nntp.telstra.net>:
> %%
> %% It is Perl everywhere else... why would it be perl?
>
>
> Read the faq. It deals with the difference between 'perl' and 'Perl'.
>
>
> Abigail
> --
> sub
_'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
> "$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub
_{print+/.*::(.*)/s}
> *_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
>
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J()))))))))))))))))))))
)))
>
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
> http://www.newsfeeds.com The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers
==-----
I have been thinking about this one for a few days (Yes I had already read
the FAQ prior) and wondering why the ambiguity, then I figured that it is
because of the sentence structure that it is confusing. The term Perl core
as it was used seems to be referring to the core 'belonging ' to Perl hence
my desire to see it capitalised, as opposed to 'the core of perl(.exe)'
which would be a little clearer as to the actual subject of the
conversation, (ie the executable).
Given the second as being the actual intention, I would change my vote to be
not 'perl core' but 'core of perl', possibly with the addition of the .exe
to make it even clearer.
Or am I way off the track here?
Wyzelli
------------------------------
Date: 23 Jun 1999 23:27:55 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <m3674egobo.fsf@moiraine.dimensional.com>
ebohlman@netcom.com (Eric Bohlman) writes:
> Olivier Dehon [8026867] (odehon@in-csg58.uk.jpmorgan.com) wrote:
> : What about double-quoted strings where no interpolation is needed?
> : Is that a bad practice and should one use single quotes instead?
>
> It's purely a matter of style.
<snip>
Lately I've been using q() and qq() instead of '' or "". I've
even been using them in place of heredocs because I can avoid
the ugly left-justified end token.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Wed, 23 Jun 1999 23:47:00 -0400
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: _Please_ improve localtime!
Message-Id: <19990623.234700.2R9.rnr.w164w@locutus.ofB.ORG>
zenin@bawdycaste.org writes:
> If you want human grokable output, use a tool designed for it.
> localtime() isn't that tool and any "realtime()" kluges would
> be little more then redundant.
But that `little' is significant -- it would remove the ease with
which Perl is used to create Y2K problems.
Nobody is confused by `1999' turning into `2000', yet so many people
have posted about `99' turning into `100' (and so many more have
written code that will fail). Imagine if the more useful interface
became the standard and the more ridiculous interface became deprecated.
That's a `little' I think is worth taking a little effort to get.
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Wed, 23 Jun 1999 21:44:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: CharlieMa <charliem@phegos.com>
Subject: Re: A foreach question
Message-Id: <3771B7A7.EE1B97D2@mail.cor.epa.gov>
[courtesy cc sent to poster]
CharlieMa wrote:
>
> OK a note of clarification for photoguy, who having only
> been exposed to the madness of perl for 3 weeks may find
> Larry Rossler's reply unintelligible. When I was learning
Umm, Larry's last name has only one 's'. But that's okay.
You should see how some posters have butchered Randal's
names.
> perl I found newsgroup replies rather confusing, especially
> the use of 'and' and 'or' for abbreviating code. See
But 'and' and 'or' [or && and ||] are not abbreviations.
They are specific features of Perl which permit the application
of powerful features when needed.
> comments below. Ignore me if I'm just being unnecessarily
> nosy.
This seems like a serious attempt to be helpful, and we
encourage that around here.
> Mr. Rossler's program looks for 'foo' in each line of
> input, if 'foo' found then it tries to look in the
> following line for 'baz', printing message if match found.
Yes.
> #!/usr/local/bin/perl -w use strict;
Oops, you forgot that essential hard return after the -w.
"use strict;" needs to be on its own line.
> while () {
> #or while(<FILEHANDLE>) {
> #if you already have FILEHANDLE associated
> #with a file as in your original example.
You need to have *something* in the while loop construct.
"while (<FILEHANDLE>)" is special, but common enough to be
considered standard Perl. <> is the angle operator, which
reads lines from the filehandle inside it [or from @ARGV
if there's no explicit filehandle in there]. This is like
saying:
while (defined($_ = <FILEHANDLE>)) { ...
so read it from the inside out. Assign a line from the
file to the default $_, check that it's defined, i.e.
not the end of file, and continue if defined.
> next unless /foo/;
>
> defined($_ = ) or die "Unexpected end-of-file\n";
This isn't what Larry wrote. Let's go back to <>. It
reads a line at a time (in scalar context, as we have here).
So just use it to read the next line.. but check whether
the line is even defined [as it won't be if the last 'foo'
is the last line of the file], and if not defined, die().
defined($_ = <FILEHANDLE>) or die "Unexpected end-of-file\n";
> #this evaluates the first half of the 'or' statement
> #and will execute the 2nd half only if the first half
> #is false.
>
> /baz/ and print "Matched baz in $_"; }
> #this tries to match /baz/ and will only execute
> #the 2nd half of the 'and' statement if the first half
> #evaluates to true.
Correct. Many people might write this differently.
print "Matched baz in $_" if (/baz/);
is one way [and there are many, so pick one you like].
But the text above is The Rosler Idiom.
> [snip]
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 24 Jun 1999 01:30:32 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Can I do this? Conditional Operator construct....
Message-Id: <1dtvosk.1vdhceb1sy004kN@p15.tc1.metro.ma.tiac.com>
Larry Rosler <lr@hpl.hp.com> wrote:
> Take your pick.
>
> TEST_EXPR ? $some_value = 1, $other_value = 0 : IF_FALSE_EXPR
Don't pick this one. It's a syntax error.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 24 Jun 1999 04:02:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Continuing fun with Hash or Lists...
Message-Id: <m5ic3.1008$Fw1.9451@nsw.nnrp.telstra.net>
In article <3770f941.422780566@24.0.3.71>,
portboy@home.com (Mitch) writes:
> coke sucks rules bites, where coke is the hash, and the rest is the
> list. How can I remove "rules" from the list?
One possibility:
use strict;
my %h;
$h{'coke'} = [ qw( sucks rules bites ) ];
splice @{$h{'coke'}}, 1, 1;
Martien
--
Martien Verbruggen |
Interactive Media Division | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd. | selective about its friends.
NSW, Australia |
------------------------------
Date: Thu, 24 Jun 1999 01:30:33 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Displaying Adds
Message-Id: <1dtvp9h.1cjstw62rsnrnN@p15.tc1.metro.ma.tiac.com>
Tad McClellan <tadmc@metronet.com> wrote:
> Matthew Bafford (dragons@dragons.duesouth.net) wrote:
> : :
> : : I want to write a simple function that displays adds and changes the
> ^^^^
> ^^^^
> : : picture every so often.
> : [snipza!]
> : Here's one that displays a new add every time it's called:
> ^^^
> ^^^
>
> Stop the madness!!!
>
> You guys aren't really displaying "add"itions are you?
>
> Surely you mean "ads" as in "ad"vertisement?
>
I suspect that you didn't look closely enough at Matthew's script. It
does indeed display "add"itions, as the original poster requested.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 23 Jun 1999 21:57:46 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: Does Perl have a future?
Message-Id: <3771BACA.55B40FC1@chatbase.com>
Joe Chan wrote:
>
> Hi, I was asking in my ISP's cgi newsgroup about the possibility of
> installing mod_perl. This is the reply I got from another user
>
> There are a number of downsides to doing this:
> 1) Memory usage. The Apache process can take up large amounts of
> memory if a lot of different modules are requested and a lot of
> different scripts are run.
> 2) A lot of scripts use global variables. Since there is effectively
> only one copy of Perl running, any global variables set by a script
> are available to other scripts and scripts that don't bother
> initialising their global variables will start off with the wrong
> values.
> 3) Configuration. It is actually quite difficult to set this up to
> work efficiently.
> 4) Development. Because a script is cached by the process you cannot
> simply upload a new version and expect Apache to serve it correctly. I
> think you have to either restart the Apache process or send it a
> signal that causes it to flush the cache.
> 5) Reliability. mod_perl is really designed for fairly static CGI
> servers where the scripts are tested thoroughly before being available
> via the enhanced server. It is possible for badly written scripts to
> interfere with other scripts and even cause the Apache process to
> crash. This would be a nightmare for the System Adminstrators.
>
> Are these criticisms valid? If so are they also true of Java Servlets
> and Java Server Pages? Is mod_perl a viable facility for ISP's to
> supply to subscriber's homepages or is it more suited to Corporate
> Intranets or larger web sites running their own servers?
>
> <snip>
> >Take a look at some info about mod_perl and fastcgi, etc. I know what
> >you're saying, and spawning so many processes can be murder on your
> >system, but if you take advantage of such things, then any complaint
> >anyone can use in such a manner is no longer valid.
> <snip>
That "snippet" was taken out of context from a prior post of mine. Of
course things can go wrong, and given the type of system, tools and
configurations it can go even "more wrong" and spell disaster, but so
can anything else with no 'special features' at all. Surely, it goes
without saying, that if someone set up and configured and server or
mod_perl in an improper manner, or moreover; wrote programs for
mod_perl without fully understanding the why's/how's and how to
implement it, then it can cause any/all of the above problems.
This of course goes without saying that it can have equally bad
side-effects with any other type thing you set up and code for/in.
There's always drawbacks in any language if it's not understood in
enough detail by the person installing it or writing for it/in it. The
reason why I stated the snipped comment, was to say how Perl is not
going to just fade away, as there's means Perl has now that override any
complaints people can use against it in regards to being a hog of
resources. But it must be coded and set up properly - as does anything
else, and should only be used in the right circumstances. Not everything
calls for the need of mod_perl.
I'd love for my host to install it, as other client's CGI processes
_are_ bogging down this server and it affects my site. He and I agreed
I'd help out by programming my CGI scripts in C, but that's too
unreasonable as the server's already too slow and it won't help me much
at all, and then I have the problem where I can't compile and every
change I want to make on the server would require me contacting the host
and having him compile it for each change. Believe me, there's a lot of
good things out there, people are unfortunately to in fear to use them,
or simply don't know what advantages it can bring to them.
--
Regards,
Tim Greer : webmaster@chatbase.com | software@linkworm.com
The ChatBase: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripts in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, +Sciences.
------------------------------
Date: Thu, 24 Jun 1999 00:35:34 -0400
From: "Andy" <ranaylor@cais.net>
Subject: foo, backtick, and others
Message-Id: <Tyic3.180$Sw3.3853292@newsie.cais.net>
Could someone please point to a resource that has definitions for terms like
foo, backtick, etc.
Not knowing these terms are getting in the way of my understanding perldoc,
man pages and the newsgroups explanations.
Your humble student
Andy...
It's not only what you know but your ability to explain it with your
listeners brain intact.
------------------------------
Date: Wed, 23 Jun 1999 21:09:46 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: global vars
Message-Id: <3771AF8A.900D993D@mail.cor.epa.gov>
Troy Knight wrote:
>
> using do will start that script separately from the script you are on.
> using require will just treat that script as part of the script you are
> using!
No. If you use system() or exec() to run it, then it will
run as a child process. If you use do(), it works more-or-less
as if you said:
eval `cat filename.pl`;
except that do() is more efficient and more concise here, as
well as checking through @INC for you and tracking the current
filename for error messages.
require() is better for library modules [as is use()] because
require() will do error checking for you, will raise exceptions
if there are problems, and won't run that external script
every time it hits it - just the first time.
See perlfunc for more on do() and require() and use().
> David Cassell <cassell@mail.cor.epa.gov> wrote in message
> [snip]
> > It sounds to me like you want to read up on the do() function.
> > This:
> >
> > do 'FILE1.pl';
> >
> > will execute the contents of the file as a Perl program. It
> > does other nice things which are covered in perlfunc.
<pickiness>
And please place your replies *after* the text you are referencing,
since that makes it easier for Usenetter to read it. In the
words of one of the illustrious members of this newsgroup,
"This isn't Jeopardy."
</pickiness> :-)
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 24 Jun 1999 01:30:34 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: HELP: Can't delete ONE stinking file with Unlink!
Message-Id: <1dtvpml.1r7tjcd9l3jk8N@p15.tc1.metro.ma.tiac.com>
<roberthp@my-deja.com> wrote:
> Can anyone tell me what I'm doing wrong???
> opendir(Desktop,"C:/WINNT/Profiles/All Users/Desktop") ||
> die "Opendir: $!";
> while ($name = readdir(Desktop)) {
> print "$name\n";
> }
> unlink("Acrobat Reader 4.0.lnk") || (<-Dies here without unlink)
> die "Unlink: $!";
You're trying to unlink the file in the current working directory, not
in C:/WINNT/Profiles/All Users/Desktop. You need to chdir to that
directory, or specify the full path when you unlink the file.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 24 Jun 1999 03:30:10 GMT
From: borkman@usa.net (Lee Borkman)
Subject: Intelligent case conversion? (eg., Title Case)
Message-Id: <3771a32a.8367011@news>
Hi,
In PerlFaq4, this RE substitution is given for doing UNintelligent
'title-case' conversions:
$line =~ s/(\w+)/\u\L$1/g;
As the FAQ points out, that capitalizes the first letter of EVERY
word, which is not usually what is needed.
I have done a fair bit of searching, but have found no existing
modules, etc, which implement intelligent title-case conversion (ie.,
Capitalise first letter of every word, but don't capitalise 'small'
words unless they are at beginning of a sentence)
I would like something like this:
$line = tcase($line, @exclusions);
...to supply my own list of words that shouldn't be capitalized
(except at the start of a sentence).
Alternatively, the function could also be called without the
exclusions list, and should have its own default list.
I have spent some time trying to write my own, but complications keep
arising, and I can see that the function really needs to do
significant parsing on the text, in order to figure out when sentences
start, etc.
Does anyone know of an existing module that implements this (or
something similar)? Or is the answer really very simple, like one
line of demented code :-)?
TIA,
Lee Borkman
------------------------------
Date: 24 Jun 1999 04:47:02 GMT
From: mr@kells.kells ()
Subject: Re: Losing Date/Time Information from Oracle Database
Message-Id: <slrn7n3ed0.bag.mr@kells.kells>
Your getting the default date format. You can do something like:
select to_char(TIME_OF_REPORT, 'YYYY-MM-DD HH:MI:SS') REPORT_TIME, *
FROM Incidents_Local
and $rowval{'REPORT_TIME'} will have what you want.
Martin
On Thu, 24 Jun 1999 02:22:38 GMT, Lee Borkman <borkman@usa.net> wrote:
>Hi,
>
>I am using DBI and DBD::Oracle to build a web page live from an
>Oracle7.3 database.
>
>Everything is fine except for the date fields.
>
>When I use SQL-NET to examine the data 'directly', a field (called
>TIME_OF_REPORT) will have a value like this:
>1999-06-01 12:05:01
>
>Okay, now I fetch the data with Perl, like this:
> $sth = $dbh->prepare("SELECT * FROM Incidents_Local" );
>
> $sth->execute;
>
> $hashref = $sth->fetchrow_hashref();
> %rowval = %{$hashref};
> print "TIME: $rowval{'TIME_OF_REPORT'}\n";
>
>
>And I get this:
>11-JUN-1999
>
>
>SO, where is the translation occurring, and can I get at the entire
>date/time? It doesn't matter what the format is, as long as nothing's
>missing.
>
>TIA,
>Lee Borkman
>
------------------------------
Date: Thu, 24 Jun 1999 04:33:23 GMT
From: borkman@usa.net (Lee Borkman)
Subject: Re: Losing Date/Time Information from Oracle Database
Message-Id: <3771b447.12747810@news>
Many thanks, that's perfect.
btw, will to_char work with other databases, or is it Oracle specific?
thanks again,
Leeb.
On 24 Jun 1999 04:47:02 GMT, mr@kells.kells () wrote:
>Your getting the default date format. You can do something like:
>
>select to_char(TIME_OF_REPORT, 'YYYY-MM-DD HH:MI:SS') REPORT_TIME, *
>FROM Incidents_Local
>
>and $rowval{'REPORT_TIME'} will have what you want.
>
>Martin
>
>On Thu, 24 Jun 1999 02:22:38 GMT, Lee Borkman <borkman@usa.net> wrote:
>>Hi,
>>
>>I am using DBI and DBD::Oracle to build a web page live from an
>>Oracle7.3 database.
>>
>>Everything is fine except for the date fields.
>>
>>When I use SQL-NET to examine the data 'directly', a field (called
>>TIME_OF_REPORT) will have a value like this:
>>1999-06-01 12:05:01
>>
>>Okay, now I fetch the data with Perl, like this:
>> $sth = $dbh->prepare("SELECT * FROM Incidents_Local" );
>>
>> $sth->execute;
>>
>> $hashref = $sth->fetchrow_hashref();
>> %rowval = %{$hashref};
>> print "TIME: $rowval{'TIME_OF_REPORT'}\n";
>>
>>
>>And I get this:
>>11-JUN-1999
>>
>>
>>SO, where is the translation occurring, and can I get at the entire
>>date/time? It doesn't matter what the format is, as long as nothing's
>>missing.
>>
>>TIA,
>>Lee Borkman
>>
------------------------------
Date: Thu, 24 Jun 1999 05:09:16 GMT
From: "Giovanni Davila" <gio98dr@yahoo.com>
Subject: Network admin
Message-Id: <04jc3.17045$NY6.6535@news.rdc1.sfba.home.com>
How can I retrieve information from my domain members? I need to find out
Service Pack #, CPU type, RAM, Server description.
I'm using NT Resource kit tools like SrvInfo and WinMSDP.
Please help!!
------------------------------
Date: Thu, 24 Jun 1999 04:25:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Alphanumeric Sort?
Message-Id: <xqic3.1015$Fw1.9451@nsw.nnrp.telstra.net>
In article <7kr6hq$df8$1@nnrp1.deja.com>,
doug_johnston@my-deja.com writes:
> @letter_nums = ("A4","A2","A1","A3");
> @temp1 = sort by_values (@letter_nums);
>
> sub by_values
> {
> ($a cmp $b)
> }
> It's a little more complex than that, but
> basically it works whenever I want to sort only
> numbers or letters, but when sorting this, it
> doesn't seem to work.
It does work.
# perl -e 'print sort { $a cmp $b } qw( A4 A2 A1 A3 ), "\n"'
A1A2A3A4
See? (And it also works with a sub, and a real array. This is just
shorter)
I doubt that the code you provide is actually what your program does.
Maybe you should check again. Maybe you should show us the actual
relevant snippets of your code that show this bug in perl.
Martien
--
Martien Verbruggen |
Interactive Media Division | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd. | selective about its friends.
NSW, Australia |
------------------------------
Date: Thu, 24 Jun 1999 04:49:21 GMT
From: tedd_scofield@my-deja.com
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <7ksdce$rqu$1@nnrp1.deja.com>
In article <7kpmla$sag$1@nnrp1.deja.com>,
chitown34@my-deja.com wrote:
> I'm trying to configure ActivePerl for use with
> Microsoft's Personal Web Server on a Windows98.
> Could someone provide me step by step instructions
> for modifying the registry as required by the
> documentation?
>
I had the same problem as you. I did a some looking and found
the following to work for my system. It may or may not work for
you:
------------
Setting up M.S. PWS to run Perl
Prerequisites:
The Microsoft Personal Web Server (MS PWS) must be installed on the
system.
Steps:
Download Perl for Windows 95/NT
Create a Perl5 folder on your hard drive and extract the contents of
the self-extracting .exe to that directory; remember to preserve the
folder names and file names.
Your directory layout should look like the following after the extract:
\Perl5\bin
\Perl5\docs
\Perl5\eg
\Perl5\lib
Run the perlw32-install.bat batch file from the \Perl5\bin directory.
Make sure that the installation updated your path in your
c:\autoexec.bat file to include x:\Perl5\bin (where x: is the drive
letter you installed Perl).
The above steps will install Perl 5 on your Windows 95/NT PC. The
steps below will configure the Microsoft Personal Web Server to run
Perl5.
Click on Start, Run, regedit.exe
Expand HKEY_LOCAL_MACHINE
Expand System
Expand CurrentControlSet
Expand Services
Expand W3Svc
Expand Parameters
Expand Script Map
Right click within the right pane/frame (of Script Map) and select New,
string value.
Enter .pl
Modify .pl and enter the full path to the perl.exe program along with "%
s %s"
example: e:\Perl5\bin\perl.exe %s %s
Create additional entries for ".cgi" and ".plx"
Exit Regedit.
If MS PWS is running then, then start and stop http services.
-- Peter Perchansky
----------
I can't remember what web page or article I found this in, but it
did the trick for me. You'll (of course) have to change
the paths to reflect your set-up.
If your concerned about mucking up your registry, just take care to
make a back-up copy of it before you dive into regedit to make the
changes. You might keep a boot disk handy while your doing (just in
case :).
PWS is a pretty cheezy server to use and I ditched it for Apache.
You might want to check it out. It's not too difficult to set up and
does a whole lot more than PWS. If your developing Perl for Web
apps, Apache will do alot better than PWS.
Hope this helps you out,
Tedd
www.ant-web.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 23 Jun 1999 23:06:25 -0500
From: Dan Lauber <jlauber@execpc.com>
Subject: Re: Perl in Win32
Message-Id: <7ksap5$ipf@newsops.execpc.com>
My solution was to set up Apache. I've never regretted it. It is great to be
able to make pages and scripts and have them all working locally, so it is faster
to change/troubleshoot.
Isaac wrote:
> Spud wrote:
> > For some reason when I try to execute my perl programs in Windows a black
> > DOS-like screen comes up for a second and then dissappears. I'm running
> > ActivePerl 517. Help, please!
>
> Win32 Perl is run from DOS. When you run your script, it brings up a DOS shell
> and executes the script. When it's done, it closes the window.
>
> My suggestion is that you run scripts from a DOS window instead of through run
> or whatever it is that you're using. That way it won't just close immidiately.
>
> --
> "Not everything that can be counted counts,
> and not everything that counts can be counted."
> - Albert Einstein
>
> http://www.spiretech.com/~gorgonous/aboutme/
--
Dan Lauber
jlauber@execpc.com
---------------------
How busy am I?
Busier than a one-legged man at an ass kicking contest.
------------------------------
Date: Wed, 23 Jun 1999 21:26:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: asio@netscape.net
Subject: Re: Perl<-->Mail Server on NT
Message-Id: <3771B38F.BE4BDE96@mail.cor.epa.gov>
asssi@my-deja.com wrote:
>
> Hi guys!
Don't be sexist. There are female Perlers too. :-)
> I have two questions for you..
>
> 1. I've studied perl and built some CGI, now I would like to add an
> ability to send email through them, on an NT platform, which software
> would you recommand to make a good Mail server that would be compatible
> with perl?
You're in luck. There's a terrific discussion of this, complete
with URLs and code and more, in the FAQ that came with your
install of Perl. So it's as close as your keyboard. Just go
to the ActivePerl FAQ in the HTML docs [it has a shortcut on
your Start Menu] and look in the section titled "Windows 95/NT"
to find the question "How do I send email from Perl for Win32?"
> 2. I'd like to connect perl with a databse, no I'm not asking how to,
> just where I can learn more about it online, again, the platform is
> Windows NT with probably Access database installed (for starters)
Great. We like people who want to learn on their own, rather
than being spoon-fed. If you don't have the DBI module installed,
use ppm to install it for you. Then read the sections in the
HTML docs on DBI and the DBI FAQ. They're under the "Module
Docs" category, under the letter 'D' [yes, they're alphabetized
for you too].
To interface with M$ Access, you'll need the DBD::ODBC module,
which ppm can also snag for you. BUT.. M$ Access is a lousy choice
for a CGI database. It's slow and fragile. You could look at
the databases which came with Perl [see in the "Root Libraries"
section of the docs], or download something like MySQL.
> I would appriciate any help, please email me a copy as well to
> asio@netscape.net
Done.
> Thanks in advance!
You're welcome!
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 24 Jun 1999 05:01:54 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Referencing question, was: "Re: use strict question"
Message-Id: <ebohlmanFDtFB6.J1u@netcom.com>
[comp.lang.perl.modules removed from followups, as there's no
module-related content]
Shane Fisher (fishers@lister.acm.wwu.edu) wrote:
: I'm doing something similar in my email script, where I have a global hash
: that maps subject strings to their appropriate filter modules
: (subroutines):
:
: $filter_hash{"default"} = \&Default_Filter::def_Filter;
: # a global hash which maps subject strings to function references
: # (filters)
:
: When calling the function using the hard reference in
: this fashion (similar to what you have, only with an argument):
:
: &$filter_hash{"default"}(@message);
You've got your precedences wrong. Dereferencing has a higher precedence
that subscripting, so your code is actually trying to treat $filter_hash
as a subroutine reference, dereference it, and then try to subscript the
result. Two solutions:
1) &{$filter_hash{default}}(@message);
Here the curlies force $filter_hash{default} to be treated as a block
which evaluates to the actual reference. Note that you don't need quotes
around a hash key if the key meets the rules for a Perl identifier.
2) $filter_hash{default}->(@message);
IMHO, this looks better.
: Is there a better way to do this? Also, for debugging purposes, I output
: the contents of the the hash, which is presumably a pointer to a function:
:
: print "I will use this function: $filter_hash{'default'}\n";
: output: "I will use this function: CODE(0x154df4)"
:
: Is there a way to have it output the name of the function instead of the
: address of it? In other words, can I get back the function name from the
: address?
No. If you want to be able to access the function name, you'll have to
use a multi-dimensional hash and store a copy of the function name yourself.
------------------------------
Date: Wed, 23 Jun 1999 23:55:19 -0500
From: "Timothy W. Valis" <tvalis@intur.net>
Subject: Repettive Text manipulation
Message-Id: <zRic3.763$MC6.4534@newsfeed.slurp.net>
I have a fixed field text file streamed to tape from a mainframe. each
record is 1545 bytes, each field is fixed in size (I have a field map, no
problem here) but the file is one long line, no CR/LF between records, in
fact, there are no record delimiters at all. I would like to use perl to
insert a CR/LF every 1545 bytes. My problem is this is a single line file
21 MB (Yes MegaBytes) in size. Any ideas? I have found lots of things that
tell me how to undo this, concatonate many lines into one, but nothing to do
this.
------------------------------
Date: Thu, 24 Jun 1999 05:13:40 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Repettive Text manipulation
Message-Id: <ebohlmanFDtFus.KqK@netcom.com>
Timothy W. Valis (tvalis@intur.net) wrote:
: I have a fixed field text file streamed to tape from a mainframe. each
: record is 1545 bytes, each field is fixed in size (I have a field map, no
: problem here) but the file is one long line, no CR/LF between records, in
: fact, there are no record delimiters at all. I would like to use perl to
: insert a CR/LF every 1545 bytes. My problem is this is a single line file
: 21 MB (Yes MegaBytes) in size. Any ideas? I have found lots of things that
: tell me how to undo this, concatonate many lines into one, but nothing to do
: this.
perldoc -f read
perldoc -f sysread
------------------------------
Date: Thu, 24 Jun 1999 01:30:36 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: suid problem with perl
Message-Id: <1dtvqf8.10byo2lnv36g7N@p15.tc1.metro.ma.tiac.com>
Mike <orionmt@cam.org> wrote:
> Why can I not see the other folders? It looks as though the "-d" option
> only recognizes folders when it is used in the current directory. It
> sees the folders of subdirectories just as files or I don't know what.
Wow. You're so close.
All file test operators look for the file relative to the _current
working directory_. Either chdir to the appropriate directory, or
include the full path to the file as the argument to the file test
operator.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6114
**************************************