[10029] in Perl-Users-Digest
Perl-Users Digest, Issue: 3622 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 2 18:17:46 1998
Date: Wed, 2 Sep 98 15:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 2 Sep 1998 Volume: 8 Number: 3622
Today's topics:
Re: ANN: Amsterdam.pm zeroth meeting (Thursday!) (David Adler)
Re: Best way to "reset" $1? <zenin@bawdycaste.org>
Re: comp.lang.perl.windows.misc (David Adler)
Re: Defining constant values in Perl using #DEFINE <zenin@bawdycaste.org>
Re: eliminate *mostly* duplicate array elements <jefpin@bergen.org>
Re: Encryption & File Locking <merlyn@stonehenge.com>
Re: Encryption & File Locking (Michael J Gebis)
Flushing data to disk for open files bowler@eisner.decus.org
Re: Flushing data to disk for open files (Larry Rosler)
Re: Flushing data to disk for open files (Jonathan Stowe)
getting browser from registry dlynch@morrisonscientific.com
Re: Help on a simple regex <ozette.brown@infotechfl.com>
Re: Help on a simple regex <ludlow@us.ibm.com>
Re: help with grep <jdw@dev.tivoli.com>
Re: help with grep (Larry Rosler)
Re: help with grep (Michael J Gebis)
Re: How do I create a directory only if it doesn't exis (Michael J Gebis)
Re: How to get a tmpfile? (Jonathan Stowe)
How to run my scripts with Perl5 and not Perl 4 when bo (Fernando)
Re: mod_perl configuration marad@usa.net
Re: Perl & Java - differences and uses (Michael Boilen)
Re: Perl & Java - differences and uses <nguyend7@msu.edu>
Re: Perl & Java - differences and uses <merlyn@stonehenge.com>
Re: Perl gurus opinion needed. (Larry Rosler)
Re: Perl gurus opinion needed. <eashton@bbnplanet.com>
Re: PERL Script/Module to read mailbox file. <ozette.brown@infotechfl.com>
Re: PERL Script/Module to read mailbox file. (Alastair)
Problem: Opening Word (ack!) doc w/ OLE <euschsh@am1.ericsson.se>
Re: simple prog that causes Segmentation fault (M.J.T. Guy)
Re: Tom Phoenix: ANSWERS WANTED! <birgitt@hamburg.citde.net>
Re: Tom Phoenix: ANSWERS WANTED! (Chris Russo)
Unix Perl Programmer Position Available <stepherd@gusun.georgetown.edu>
Re: We don't need no stinking benchmarks (was Re: Newbi <zenin@bawdycaste.org>
Re: Why Perl ? <zenin@bawdycaste.org>
Re: Why Perl ? (Michael Wang)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Sep 1998 21:12:07 GMT
From: dha@panix.com (David Adler)
Subject: Re: ANN: Amsterdam.pm zeroth meeting (Thursday!)
Message-Id: <6skcb7$h0n@news1.panix.com>
On Tue, 01 Sep 1998 12:14:13 +0100, Leon Brocard <l.brocard@elsevier.nl> wrote:
>This is the two-day warning for the Amsterdam.pm zeroth meeting.
>Ignore if you're not in Amsterdam and don't know about perl.
>Also ignore if you're a dancing chihuahua...[1]
>[1] Those crazy NY.pm people...
Hey, we brought her to the conference.... not our fault if you missed
the dancing. :-)
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"This is Mace's planet. We Just Live here."
------------------------------
Date: 2 Sep 1998 21:12:30 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Best way to "reset" $1?
Message-Id: <904770697.186638@thrush.omix.com>
Jonathan Feinberg <jdf@pobox.com> wrote:
: Not according to perlre:
: The scope of $<digit> (and $`, $&, and $') extends to the end
: of the enclosing BLOCK or eval string, or to the next
: successful pattern match, whichever comes first.
: ^^^^^^^^^^
Duh...my bad. Teach me to comment on code constructs I almost
never use. :-)
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 2 Sep 1998 21:19:36 GMT
From: dha@panix.com (David Adler)
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <6skcp8$h0n@news1.panix.com>
On 26 Aug 1998 18:31:22 GMT, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <6s1he0$cg$1@msunews.cl.msu.edu>,
> Dan Nguyen <nguyend7@msu.edu> writes:
>: How about comp.lang.perl.illiterate.misc
>
>Some groups I'd like to see (but not necessarily read)
[list of possible groups including
> comp.lang.perl.i-want-to-fellate-bill-gates
snipped]
>Maybe those would help kill the noise. :-)
You forgot comp.lang.perl.make-money-fast and
comp.lang.perl.good-times-virus.
HTH. :-)
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"If you want a real optimist, look up Ray Bradbury. Guy's nuts.
He actually likes people." - David Brin
------------------------------
Date: 2 Sep 1998 21:25:50 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Defining constant values in Perl using #DEFINE
Message-Id: <904771496.665562@thrush.omix.com>
Andrew M. Langmead <aml@world.std.com> wrote:
: I've always wondered how someone could "accidentally modify" a global
: variable which is documented (in this case, by the all uppercase
: convention) as being a constant.
And if one really, really wants to make sure they don't
"accidentally" do this, they can drive there point home with
this:
*FOO = \'bar';
$ perl -e '*FOO=\"bar"; $FOO="dog";'
Modification of a read-only value attempted at -e line 1.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Wed, 2 Sep 1998 16:28:44 -0400
From: Any more mini-dilemmas I should know about? <jefpin@bergen.org>
To: Phil R Lawrence <prl2@lehigh.edu>
Subject: Re: eliminate *mostly* duplicate array elements
Message-Id: <Pine.SGI.4.00.9809021605090.5160-100000@vangogh.bergen.org>
>I grabbed the following from the FAQ to eliminate duplicate array elements:
>
> undef %saw;
> @list = grep(!$saw{$_}++, @raw_list);
>
>However, I need to eliminate duplicate array elements *even* if they have differing whitespace. (So I guess they would be mostly
>duplicate.)
>
>Example: Keep only one of the following:
>
>" hallo"
>" hallo "
>
>Any ideas? I'm a little dim on how the FAQ solution actually works, so I'm pretty much in the dark about modifying it.
I would suggest this instead of the current FAQ solution:
@uniq = keys (%{ { map {$_, 1} @raw }});
I'll run a BenchMark to see which is faster... aww, I lose. :(
Well, the two examples are similar, so I'll explain mine for egotistical
reasons.... :)
Now, what does C<@uniq = keys (%{ { map {$_, 1} @array } });> actually do?
@uniq the array of uniq values
keys (...) returns the keys of the upcoming hash
%{ { ... } } makes a hash out of a hash ref (passed to keys())
map {$_, 1} @array for each $_ in @array, it returns ($_, 1) to the
hash; in other words, it says $hash{$_} = 1
So it takes an array, and for each element, it says the hash value is 1.
You can only have one key of the same name, so if @array = qw(a b a a c),
then the temporary hash is (a, 1, b, 1, c, 1). Then, it takes the keys,
which are qw(a b c), and sends them to @uniq.
The FAQ's solution does this:
undef %saw; clears the %saw hash
@list the array of uniq values
grep (...) returns something done on the @raw_list to @list
!$saw{$_}++ whoa: if $saw{$_} is not true (0), this is true,
so return this element to @list; IN ADDITION,
increment $saw{$_} so that this element will not
be doubled (this is done AFTER the 'not true' test
@raw_list the list being iterated on
I will never again talk so much. Luckily, I haven't been talking all this
time. ;)
--
Serions-nous de ceux qui resistent ou bien les moutons d'un
troupeau, S'il fallait plus que des mots...
- "Ne en 17 a Leidenstadt" (Jean-Jacques Goldman)
-- Jeff Pinyan | users.bergen.org/%7Ejefpin | techmaster@bergen.org --
NYPM | ICQ# 10222129 | 10222129@pager.mirabilis.com | qw[jeff] on EFnet
&jp('"($``','','$)EDF8```','$*52J4```','$+E1G4```','#J``@','#2__`');sub
jp{for$w(@_){$_=unpack('B48',unpack('u',$w));$c=~tr/10/# /;print;}}
------------------------------
Date: Wed, 02 Sep 1998 20:47:18 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Encryption & File Locking
Message-Id: <8c67f62qez.fsf@gadget.cscaper.com>
>>>>> "Jim" == Jim Michael <jim.michael@gecm.com> writes:
Jim> system "cat /myserver/mydir/$myfile | des -dk $mypassword >
Jim> /myserver/mydir/$mydecryptedfile";
Jim> Then when you are done with the file, write it back to the encrypted
Jim> file:
Jim> system "cat /myserver/mydir/$mydecryptedfile | des -ek $mypassword >
Jim> /myserver/mydir/$myfile";
If this had been comp.unix.questions or comp.unix.shell, you would
have recieved one of my "useless use of cat" awards.
Good thing it isn't. :)
--
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: 2 Sep 1998 21:05:41 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Encryption & File Locking
Message-Id: <6skbv5$rup@mozo.cc.purdue.edu>
Randal Schwartz <merlyn@stonehenge.com> writes:
}If this had been comp.unix.questions or comp.unix.shell, you would
}have recieved one of my "useless use of cat" awards.
}Good thing it isn't. :)
This is still off topic, but I'm going to try to win a lifetime
achievement "useless use of cat" award with this entry:
ls | cat /dev/fd/0 | more
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 2 Sep 1998 20:00:25 GMT
From: bowler@eisner.decus.org
Subject: Flushing data to disk for open files
Message-Id: <1998Sep2.160025.1@eisner>
Either I'm blind or it's late or this isn't in the faq so
I have a perl script that does...
open (MYOUT, ">file.out");
and then goes on to do a bunch of
print MYOUT $stuff
over the next several hours.
Is there any way in perl to get it to flush what's been written so that I can
look at the file to track progress? I realize I could close MYOUT and re-open
it using ">>file.out" but that seems so in-elegant...
ideally, I'd like a "flush every n minutes" but a "flush now" would also work
for me...
Thanks!
Bruce
------------------------------
Date: Wed, 2 Sep 1998 14:12:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Flushing data to disk for open files
Message-Id: <MPG.105754ad5172c81e98978a@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <1998Sep2.160025.1@eisner> on Wed, 2 Sep 1998 20:00:25 GMT,
bowler@eisner.decus.org <bowler@eisner.decus.org> says...
...
> open (MYOUT, ">file.out");
Show an 'open' here without a success test and get your wrist slapped.
> and then goes on to do a bunch of
>
> print MYOUT $stuff
Or unterminated statements :-)
> over the next several hours.
>
> Is there any way in perl to get it to flush what's been written so that I can
> look at the file to track progress? I realize I could close MYOUT and re-open
> it using ">>file.out" but that seems so in-elegant...
>
> ideally, I'd like a "flush every n minutes" but a "flush now" would also work
> for me...
Try seeking to where you are:
seek MYOUT, 0, 1 or die "Couldn't seek. $!\n";
IIRC this will flush the buffers, but I haven't found that in my Unix or
Perl documentation. Alternatively, try 'tell()'. This should *have* to
flush the buffers to return a meaningful file position.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 02 Sep 1998 21:40:19 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Flushing data to disk for open files
Message-Id: <35edb0b6.13749265@news.btinternet.com>
On Wed, 2 Sep 1998 20:00:25 GMT, bowler@eisner.decus.org wrote :
>Either I'm blind or it's late or this isn't in the faq so
>
>I have a perl script that does...
>
> open (MYOUT, ">file.out");
>
>and then goes on to do a bunch of
>
> print MYOUT $stuff
>
>over the next several hours.
>
>Is there any way in perl to get it to flush what's been written so that I can
>look at the file to track progress? I realize I could close MYOUT and re-open
>it using ">>file.out" but that seems so in-elegant...
>
>ideally, I'd like a "flush every n minutes" but a "flush now" would also work
>for me...
>
I would suggest looking at the perlvar documentation searching for
"flush" or "FLUSH" - I am sure this will lead you to enlightenment.
You might also look at the first item in perlfaq5 whilst you are
waiting for your eye test ;-}
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Wed, 02 Sep 1998 21:36:36 GMT
From: dlynch@morrisonscientific.com
Subject: getting browser from registry
Message-Id: <6skdp4$j67$1@nnrp1.dejanews.com>
Hi,
I need to extract the default browser from the NT registry. Does anyone know
how I can do this, or where to read up on it? Thanks in advance.
David.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 02 Sep 1998 16:21:08 -0400
From: Ozette Brown <ozette.brown@infotechfl.com>
Subject: Re: Help on a simple regex
Message-Id: <35EDA8B4.60170683@infotechfl.com>
Andreas,
Try something like this:
if (/(ab).*/)
{
$x = $1;
print "$x\n";
}
This should match the first occurrence of "ab". For more info, see the perl
docs on regular expressions.
Thanks,
Ozette
Andreas Vierengel wrote:
> Hi everybody!
> I am reading lines from a file and do a regex on each line.
> I want to match a line if it contains a certain string only ONE time.
> Example:
> string to match: 'ab'
>
> possible lines:
>
> "abdfgab1234abhj" <-- should not be matched because of three
> occurences of 'ab'!
> "kjhdsbabakkioi" <-- should be matched!
>
> Is ist possible to do this in one regex?
>
> --Andy
>
--
Ozette Brown <Ozette.Brown@Infotechfl.com>
Webmaster, Infotech Inc.
5700 S.W. 34th St. Suite 1235 Phone: 352-375-7624
Gainesville, FL 32608-5371 Fax: 352-373-9586
------------------------------
Date: Wed, 02 Sep 1998 16:07:49 -0500
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Help on a simple regex
Message-Id: <35EDB3A5.942430D4@us.ibm.com>
I don't think he meant to match the first occurrence of "ab". I think
that he wanted to call it a match only if "ab" occurred exactly one time
in a particular string.
#!/usr/bin/perl -w
$string[0] = "12345678cdefghij"; # Should not match
$string[1] = "xxxxxxxabyyyyyyy"; # Should match 1 time
$string[2] = "wwwwabzzzzzzabqq"; # Should match 2 times
# -- One way to do it --
print "\n";
print "Using s//g...\n";
foreach (@string) {
$matches = s/ab/ab/g;
$matches = 0 if (!$matches);
print "string=$_ matches=$matches\n";
}
# -- OR --
print "Using split...\n";
foreach (@string) {
@matches = split /ab/, $_;
print "string=$_ matches=$#matches\n";
}
Check the documentation for s// and split for more info. Personally, I
looked up the return value of s// in "Programming Perl" (pg. 72 in 2nd
ed), and then just added the "split" version to give you a couple of
choices.
--
James Ludlow (ludlow@us.ibm.com)
Disclaimer: This isn't technical support, and all opinions are my own.
Ozette Brown wrote:
[snip]
> if (/(ab).*/)
> {
> $x = $1;
> print "$x\n";
> }
>
> This should match the first occurrence of "ab". For more info, see the perl
> docs on regular expressions.
[snip]
> Andreas Vierengel wrote:
>
> > Hi everybody!
> > I am reading lines from a file and do a regex on each line.
> > I want to match a line if it contains a certain string only ONE time.
> > Example:
> > string to match: 'ab'
> >
> > possible lines:
> >
> > "abdfgab1234abhj" <-- should not be matched because of three
> > occurences of 'ab'!
> > "kjhdsbabakkioi" <-- should be matched!
[snip]
------------------------------
Date: 02 Sep 1998 14:40:03 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: help with grep
Message-Id: <obemtu8fsc.fsf@alder.dev.tivoli.com>
nana@my-dejanews.com writes:
> I have two arrays: @words and @strings. I want to match any of @words to any
> of @strings and in case they match, exit.
>
> foreach (@words) {
> if ( grep ( /$_/i, @strings ) ) { die; }
> }
>
> I guess this isn't right. I can't really figure out what is wrong, does grep
> change the value of $_? and what does grep return when no match is found?
read up on grep with perldoc -f grep, yes it also uses $_, so your
outer foreach should use a variable:
foreach $i (@words) {
if ( grep ( /$i/i, @strings ) ) { die; }
}
your grep does $_ =~ /$_/i; # which probably isn't what you wanted.
Considering the type of searching you're doing, you will probably be
going over the @strings array many times, you'd probably be better off
storing @strings in a hash, so you only have to iterate over the array
once:
map { $strings{$_}++ } @strings; # lazy to use map for side effect only
grep { $strings{$_} } @words and die;
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
------------------------------
Date: Wed, 2 Sep 1998 13:54:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help with grep
Message-Id: <MPG.105750548c21d89b989789@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <obemtu8fsc.fsf@alder.dev.tivoli.com> on 02 Sep 1998 14:40:03
-0500, Jim Woodgate <jdw@dev.tivoli.com> says...
...
> map { $strings{$_}++ } @strings; # lazy to use map for side effect only
> grep { $strings{$_} } @words and die;
That first line might be written as:
@strings{ @strings } = (1) x @strings;
and run lots (like an order of magnitude!) faster if one cared. Thanks
again, Uri.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 2 Sep 1998 21:12:50 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: help with grep
Message-Id: <6skcci$ser@mozo.cc.purdue.edu>
lr@hpl.hp.com (Larry Rosler) writes:
}In article <obemtu8fsc.fsf@alder.dev.tivoli.com> on 02 Sep 1998 14:40:03
}-0500, Jim Woodgate <jdw@dev.tivoli.com> says...
}...
}> map { $strings{$_}++ } @strings; # lazy to use map for side effect only
}> grep { $strings{$_} } @words and die;
}That first line might be written as:
}@strings{ @strings } = (1) x @strings;
}and run lots (like an order of magnitude!) faster if one cared. Thanks
}again, Uri.
Ok, the last time this construct was posted, I sat down and thought
about it. I thought so hard I vomitted, and I still haven't achieved
enlightenment. So...can somebody (carefully) explain this to me?
Thanks.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 2 Sep 1998 20:57:11 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: How do I create a directory only if it doesn't exists
Message-Id: <6skbf7$rir@mozo.cc.purdue.edu>
gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
}lr@hpl.hp.com (Larry Rosler) writes:
}}mkdir $dir, 0777 or die "Couldn't mkdir $dir. $!" unless -d $dir;
}There's actually a (probably minor) race condition where two separate
}processes could detect that the directory doesn't exist before either
}gets a chance to create it. Be sure to check the result of mkdir if
}this is an issue.
I might have added: Larry's code above is the only response so far that
actually does the check.
But I didn't, so instead of making my point (which was to stress the
importance of the "die" above) I implied the opposite. That was bad.
In summary: Do like Larry.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 02 Sep 1998 21:40:21 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: How to get a tmpfile?
Message-Id: <35edb355.14182349@news.btinternet.com>
On 2 Sep 1998 19:36:05 GMT, RHS Linux User wrote :
>i have read the perlfaq5. the simple way is to
>use IO::Handle::new_tmpfile
>but i still don't get it!
>
>would you show me a example the use IO::Handle::new_tmpfile ?
Er, no But you could try IO::File::new_tmpfile - see the pod for
IO::File.
This was apparently a bug in the previous version of perlfaq5. This
has been remedied in in the perlfaq5 of the 5.005 distribution.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 2 Sep 1998 20:38:49 GMT
From: fmiramon@students.wisc.edu (Fernando)
Subject: How to run my scripts with Perl5 and not Perl 4 when both are installed in the same place
Message-Id: <6skacp$16c0$1@news.doit.wisc.edu>
Both versions are installed in /usr/bin/
.. so if i run a script it automatically tries to run perl4 and not perl5 even
if I have " #!/usr/bin/perl5 " at the top of the script.
How do i know is running perl4 and not perl5?
Because some libraries are not available in perl 4 and everytime I try to run
the script by tyiping "name.pl" I get:
"use:: not found"
but if i do "perl5 name.pl" the script runs nicely.
Thanks in advance...
------------------------------
Date: Wed, 02 Sep 1998 21:01:50 GMT
From: marad@usa.net
Subject: Re: mod_perl configuration
Message-Id: <6skbnu$grg$1@nnrp1.dejanews.com>
First, many thanks to everyone who is assisting me.
>In article <comdog-ya02408000R2808982119520001@news.panix.com>,
> comdog@computerdog.com (brian d foy) wrote:
> In article <6s72au$7gi$1@nnrp1.dejanews.com>, marad@usa.net posted:
>[snip]
> >Alias /perl/ /usr/apache/share/perl/
> ><Location /perl>
> >SetHandler perl-script
> >PerlHandler Apache::Registry
> >Options ExecCGI
> ></Location>
>Try to include "PerlSendHeader On" within that <Location>.
Changing this setting didn't seem to do anything. It's hard to tell what's
going on because no error messages are reported in the log; the page just
comes up showing the source, not running it. If I activate CGI, the test-cgi
script (running in the cgi-bin directory, not ../perl), says Apache/1.3.1
(Unix) mod_perl/1.15, so I'm pretty sure the compile went okay.
>/bik
>In article <slrn6umne3.5ft.randy@theory.uwinnipeg.ca>,
> randy@theory.uwinnipeg.ca (Randy Kobes) wrote:
> On Mon, 31 Aug 1998 14:00:42 GMT, marad@usa.net <marad@usa.net> wrote:
> >Yes, yes. Just for fun, I tried commenting out the .cgi line in my srm.conf
> >(and then restarting the server, of course), but no cigar. Other ideas,
> >anyone?
> >
> >In article <comdog-ya02408000R2808982119520001@news.panix.com>,
> > comdog@computerdog.com (brian d foy) wrote:
> >> In article <6s72au$7gi$1@nnrp1.dejanews.com>, marad@usa.net posted:
> >>
> >> >After many hassles, I successfully complied Apache 1.3.1 for Linux with
> >> >mod_perl, but I still can't seem to get it to actually run scripts.
> >> >Instead,
> >> >it just displays the script. I have searched the newsgroups and FAQs over
> >> >and
> >> >over, but nothing seems to work. My srm.conf looks like this:
> >>
> >> >AddHandler cgi-script .cgi #Do I need this line? Is it in the way?
> >>
> >> i have this commented out in my config, but that doesn't mean anything.
> >> my servers don't allow executable content outside of designated
> >> directories.
> >>
> >> >Alias /perl/ /usr/apache/share/perl/
> >> ><Location /perl>
> >> >SetHandler perl-script
> >> >PerlHandler Apache::Registry
> >> >Options ExecCGI
> >> ></Location>
> >>
[snip]
>
> Hi,
> The parts of the configuration files you posted also look similar
> to mine, so there's nothing obviously wrong there. Does the rest of
> your server function OK - static pages, etc.?
Yes.
> Are you using the latest mod_perl, and CGI.pm if that's being used in your
> scripts?
I think so. I would be worried about CGI.pm except that I don't think
mod_perl is even *trying* to run my scripts. For some reason, despite the
.conf files, it doesn't seem to recognize the files as perl scripts in the
first place.
> There were such problems in particular combinations of some earlier
> versions of these that have since been resolved.
> There may be something else in one of the *.conf files that's
> causing this problem - for example, do you have a ScriptAlias
> definition pointing to the same directory?
No.
> Or the variable PerlSendHeader set for this directory in another part of
> the configuration files?
Well, I just set it as instructed above, but it doesn't seem to have been set
before.
> Or perhaps the real /perl directory
> is contained in another set of directives that is causing a conflict?
What do you mean by the "real" /perl directory? What other sets of directives
might do this?
> Another possibility that I encountered is that many of the
> default locations changed in Apache 1.3.x, particularly the
> location of the configuration files. What might happen is that
> if you compile mod_perl the "simple" way, as opposed to using
> the new APACI interface,
I used APACI. In fact, this is the only way I could get it to compile
successfully.
> then manually copy httpd to the relevant
> location, it may be using a different, older set of configuration
> files than the ones you're editing. Do you start httpd using the -f
> switch telling it what configuration file to use?
I've been using "apachectl start". So far I haven't been able to get the -f
switch to work correctly, but I'll keep trying.
> Other than that, you might want to search the information on
> http://perl.apache.org/
> particularly for the links there to archives of the (pretty active)
> mailing list - this problem is not rare, for a variety of reasons,
> and maybe something there might help.
>
> --
> Best regards,
> Randy Kobes
[snip]
I continue to search the various FAQs, web sites, newsgroups, etc. I will
post the solution here when I find it. The strange thing is that I swear I
saw a post from someone else describing the same problem a while back, but I
can't seem to find it now. Ah well...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 2 Sep 1998 20:24:11 GMT
From: mgb@cs.brown.edu (Michael Boilen)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6sk9hb$oeq@cocoa.brown.edu>
On Wed, 02 Sep 1998 15:02:52 GMT, Nathan V. Patwardhan <nvp@shore.net> wrote:
> yong (yong@shell.com) wrote:
>
> : On the other hand, the Java people don't like Perl mainly because Perl looks
> : "ugly" and "cryptic" at first sight.
>
> class WTF {
> public mane hairy cat implements SexyPimple in an impureFashion {
> // more stuff
> }
> }
>
> So the above is very clear? :-)
No, but it is also incorrect :)
------------------------------
Date: 2 Sep 1998 20:51:58 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Perl & Java - differences and uses
Message-Id: <6skb5e$j6r$1@msunews.cl.msu.edu>
In comp.lang.perl.misc yong <yong@shell.com> wrote:
: On the other hand, the Java people don't like Perl mainly because Perl looks
: "ugly" and "cryptic" at first sight.
Perl is a bit "ugly" and "cryptic," but that's why perl is different
from Java. Perl's regex is mostly why it seems to be so cryptic.
In fact its on sub-language. If Perl didn't have regex (it would be
Perl,) then it would look like a lot of other boring old languages.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Wed, 02 Sep 1998 20:59:19 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <8czpci1baj.fsf@gadget.cscaper.com>
>>>>> "David" == David Cantrell <NukeEmUp@ThePentagon.com> writes:
David> Make it C(\+{2}){0,1} just to add a fe more bizarro characters ;-)
How about C([+]{2})? ? :)
--
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: Wed, 2 Sep 1998 13:33:27 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl gurus opinion needed.
Message-Id: <MPG.10574b6d7ba716cb989788@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <35ed9475.7052754@news.btinternet.com> on Wed, 02 Sep 1998
19:30:13 GMT, Jonathan Stowe <Gellyfish@btinternet.com> says...
> On Tue, 01 Sep 1998 14:11:54 -0400, John Porter wrote :
> >Dmitry Dorofeev wrote:
> >> I have possibly{0,1} new word for general purpose use.
> >> it's sounds 'Perlacker'.
> >
> >Go ahead and use it, if that's what seems natural.
> >Don't expect native English speakers to pick it up, though.
> >"Perl Hacker" suits us just fine.
>
> Of course there are people in Britain who already pronounce "Perl
> Hacker" as Dmitry proposes (or would if they had cause to utter the
> phrase) (Think My Fair Lady).
Dmitry's problem is that pronouncing it in Russian gives something like
"Perl Gacker". Gack! He is trying to drop the 'H' and it isn't as easy
as it is for the Cockneys.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 02 Sep 1998 21:42:24 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl gurus opinion needed.
Message-Id: <35EDB96A.C276ED31@bbnplanet.com>
> > >Go ahead and use it, if that's what seems natural.
> > >Don't expect native English speakers to pick it up, though.
> > >"Perl Hacker" suits us just fine.
i have always found the word 'hacker' to be interesting. its root comes
from the word 'hackney' which was a fancy type of carriage horse until
they became so common, hence the word 'hackneyed', that they became
passe'. the action of 'to hack' has the connotation of shoddy,
commonplace, pedestrian. and of course 'a hack' is a horse of the
non-stellar variety. so, does hacker really have the proper meaning that
you want to convey? indeed, it is difficult to think up a new phrase
that rolls off the tongue quite so well. hhmmm...
perl jerky-boy
perl tiger
perl oranguntan
perl monkey (has potential)
perl wanker (for the english ;)
perl minor-deity
perl constellation
perl geeky-coder-boy
perl monster
perl fright
perl circuit
perl nymph
perl angel
perl daemon (has potential)
perl master
perl slave
perl devotee'
perl cumulonimbus
perl storm
perl hurricane
perl twister (just another perl twister...)
perl beer drinker (too accurate perhaps)
perl picard (warp 9!)
perl psycho
perl rocket
perl thermonuclear device
perl olympian
perl wizard
perl sorcerer
perl knight
perl dragon
i could go on...this is fun. ideas anyone?
e.
------------------------------
Date: Wed, 02 Sep 1998 16:02:37 -0400
From: Ozette Brown <ozette.brown@infotechfl.com>
Subject: Re: PERL Script/Module to read mailbox file.
Message-Id: <35EDA45D.16C76EF5@infotechfl.com>
Paul,
Try the Net::POP3 module.
Thanks,
Ozette
jteens@my-dejanews.com wrote:
> Hi there, I've 1 POP email account and I want everyone to read my mailbox
> file without use POP or IMAP protocol (I don't want to give out my login &
> password to everyone). So I want to create web based email (for read message
> only) to handle my mailbox (/var/spool/mail/mymailbox) directly. I'm looking
> for perl script/module to handle mailbox file directly. Any help would be
> mostly appreciated. Thanks, Paul
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
--
Ozette Brown <Ozette.Brown@Infotechfl.com>
Webmaster, Infotech Inc.
5700 S.W. 34th St. Suite 1235 Phone: 352-375-7624
Gainesville, FL 32608-5371 Fax: 352-373-9586
------------------------------
Date: Wed, 02 Sep 1998 20:54:57 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: PERL Script/Module to read mailbox file.
Message-Id: <slrn6urfre.4g.alastair@calliope.demon.co.uk>
jteens@my-dejanews.com <jteens@my-dejanews.com> wrote:
>Hi there, I've 1 POP email account and I want everyone to read my mailbox
>file without use POP or IMAP protocol (I don't want to give out my login &
>password to everyone). So I want to create web based email (for read message
>only) to handle my mailbox (/var/spool/mail/mymailbox) directly. I'm looking
>for perl script/module to handle mailbox file directly. Any help would be
>mostly appreciated. Thanks, Paul
There's also a Mail::Folder module (I think that was what it's called). Check
out CPAN (http://www.cpan.org).
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Wed, 02 Sep 1998 15:21:12 -0500
From: Charles Sherman <euschsh@am1.ericsson.se>
Subject: Problem: Opening Word (ack!) doc w/ OLE
Message-Id: <35EDA8B8.754B23BD@am1.ericsson.se>
Ok I've got NT, I've got Active PERL 5.00502, I've got Randals books
(you name it I've got it or at least its with in walking distance). With
all of this and a good bit of surfing and reading of MS docs, I cannot
figure out how to map the following bit of VB code to PERL. I tried
various combinations but I have no idea about how the method should be
invoked from PERL. The "FileName:=" is throwing me.
VB code:
Application.Documents.Open FileName:="C:\DOCS\MYDOC.DOC"
PERL (I think this would work or some variation):
use OLE;
$wd = CreateObject OLE "Word.Application.8" || die "CreateObject: $!";
$wd->{visible}=1;
$wd->Documents->Open('FileName:="C:\DOCS\MYDOC.DOC"');
#I've tried without '' also
This will launch Word but does not bring up the document.
If you have any suggestions, ideas, etc. I would like to know.
Thanks
Charlie
------------------------------
Date: 2 Sep 1998 21:27:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: simple prog that causes Segmentation fault
Message-Id: <6skd8e$kkh$1@pegasus.csx.cam.ac.uk>
Tom Phoenix <rootbeer@teleport.com> wrote:
>On 30 Aug 1998, Pascal Rigaux wrote:
>
>> Subject: simple prog that causes Segmentation fault
>
>If it still causes a segfault under 5.005, please use the perlbug command
>to report it. Thanks!
This bug is mended in 5.005_xx and will also be mended in 5.004_05-to-be.
Mike Guy
------------------------------
Date: Wed, 02 Sep 1998 16:30:05 +0000
From: Birgitt Funk <birgitt@hamburg.citde.net>
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <6ska9g$h2$1@trader.ipf.de>
Nathan V. Patwardhan wrote:
> It's unfortunate that people read the posting as an attack on Tom's
> character, which it was not. On one hand, people cannot be honest
> with themselves about the lack of content or depth in a pre-canned
> response, and apparently they cannot be convinced otherwise.
Why should a FAQ question get more than a pre-canned response. There
is a lack of content or depth in the question, so there can't be
a mass of content or depth in the answer.
> (2) answering questions en masse with the cut and paste method.
> Most people won't read FAQs or lengthy pre-canned postings. Too
> much of too little cluttlers up the joint.
FAQ questions and T.P.'s answers are easily skipped over. What
clutters
are threads like these.
> Most people seem not
> to return if they're ignored.
Does this concern you, if they don't return or are you glad they don't
?
Why is it of any importance at all ?
> It's better to say nothing most of the time: at least these days.
[snip]
> But if they realize how long
> it's taking them to get a response, they will be FORCED to scour ANY
> and ALL resources to figure things out for themselves. And from where
> many folks stand, this is not a bad thing.
Sure, so don't post an answer. Ignore. Can you discipline others to
do the same ? I guess not - the same way you cannot discipline someone
not to post FAQs or read the FAQs.
> It's better to say nothing and get people to research things in other
> ways.
And you know for sure that people who didn't get an answer on clpm -
whatever kind - all are angels and go off right away to be responsible
researchers of their own ever after ? How come, are you psychic ?
What do you have in hands to prove your assumption ?
I bet against it - namely that fifty percent of people who post a FAQ,
don't get an answer and don't return, will never search for an answer
on their own afterwards - for reasons completely unrelated to clpm.
I also bet that fifty percent who do get a T.P. answer nevertheless
will
not go and solve their problems on their own. Also for completely
unrelated
reasons to clpm.
What almosts fascinates me, is that there is apparently this zealeous
belief
in a couple of posters here assuming that clpm responses to newbie's
FAQs
are something of great importance. They are not. The answers to real
Perl questions are -and they get always very good responses.
I am a newbie - I read clpm almost exclusively as a study in human
behaviour - :-) and almost never as a study of Perl.
Nobody has made me read any documents, I don't want to read, nor
influenced
my timing of when I study what.
I don't post FAQs, but I do post noisy responses like this one. Not
what you want, obviously.
So where is the wisdom of your question ?
Obviously Tom Phoenix answers NEVER generate noisy threads like this
one.
That should answer your question and refute your argument.
Birgitt Funk
------------------------------
Date: Wed, 02 Sep 1998 14:09:39 -0700
From: news@russo.org (Chris Russo)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <news-0209981409390001@buzz.hq.alink.net>
In article <cAgH1.126$kE2.1100174@news.shore.net>, nvp@shore.net (Nathan
V. Patwardhan) wrote:
>Maybe or maybe not! But it won't be possible to give you the correct
>answer until we measure this newsgroup and it weighs less than a
>phonebook for the burrough of Queens. Hope this helps!
I'm convinced.
"Nathan V. Patwardhan" == "Mee"
Even if it's not true, their equally plonkable.
Regards,
Chris Russo
--
Chris Russo
news@russo.org
http://www.russo.org
------------------------------
Date: Wed, 02 Sep 1998 17:08:34 -0400
From: Dave Stephens <stepherd@gusun.georgetown.edu>
Subject: Unix Perl Programmer Position Available
Message-Id: <35EDB3D2.D78C6EC3@gusun.georgetown.edu>
The technical services department of the Georgetown University UIS
(Univ. Information Services) department is seeking the following.
Main campus, Georgetown University, Washington D.C.
Previous Systems Programmer Positions have been salaried at
grade 12 or $47,524 - $64,890 annually.
Position Opening Announcement: Systems Programmer
Brief Description:
This position will work closely with two other Unix Systems
Administrators in the AITS Technical Services Group. Primary
responsibility is the development and maintenance of UNIX Shell scripts,
Perl, CGI and secure TCP/IP socket programming for account management
and system utilities. Other responsibilities include UNIX systems
management and security.
Minimum qualifications:
B.S. degree with minimum 12 months familiarity with UNIX system
administration. Demonstrated experience in the development of UNIX
Shell, Perl and CGI scripts and in the installation of UNIX Internet
utilities and software. Working knowledge of TCP/IP network protocols,
socket programming and UNIX data security is also required. Experience
with implementing and/or developing any of the following is
recommended. Sun Solaris, Java, TCP wrappers, Network File System,
Domain Name System, Sendmail, NNTP, ListProc, TCP/IP.
Contact Scott Allen at scott@gunet.georgetown.edu for more information.
http://www.georgetown.edu/uis for UIS homepage.
------------------------------
Date: 2 Sep 1998 21:23:28 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: We don't need no stinking benchmarks (was Re: Newbie RE Question)
Message-Id: <904771355.67069@thrush.omix.com>
Daniel Grisinger <dgris@rand.dimensional.com> wrote:
>snip<
: If your program is too slow you are much better off
: reevaluating it and making fundamental algorithmic changes
: than you are micro-optimizing the performance of your
: regular expressions. You'll see far greater performance
: benefits through algorithmic improvements than any number of
: 1/27,000 of a second speedups are going to produce.
As with much of anything, "it depends".
In some cases cutting 50ms makes a huge difference. I maintain
a few enterprise level application servers in Perl, and with
3k to 10k clients, every ms counts. These are times when perl's
slow sub calls start making a big difference, but that can't
be helped. I can however, "micro-optimize" nearly everything
else.
Why not C? I need an extremely rapid development environment
in a setting where large amounts of arbitrary data-munging (to
talk between legacy systems) is the rule, and nothing beats
Perl for that.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 2 Sep 1998 21:11:22 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Why Perl ?
Message-Id: <904770629.571842@thrush.omix.com>
John Porter <jdporter@min.net> wrote:
: To this you should add "use Shell;".
: Here's my hack of the above code:
>snip<
: Now all we need is csh-like history recall/editing.
How about this:
use Shell;
use Term::ReadLine;
my $term = new Term::ReadLine "Perl Super Shell";
$IPERL::l=1;
while (defined ($_ = $term->readline("$IPERL::l> ")) ) {
print eval;
print ($@ || "\n");
$IPERL::l++;
$term->addhistory($_) if /\S/;
}
__END__
Make sure you install one of the more useful ReadLine libs such
as Term::ReadLine::Gnu or Term::ReadLine::Perl (Term::ReadLine will
use whatever the best you have automatically).
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 2 Sep 1998 20:54:04 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: Why Perl ?
Message-Id: <6skb9c$226$1@news.ml.com>
>Yes, I read the Camel book too and found
>#!/usr/bin/perl
>while(<>) {
> print eval $_;
> die $@ if $Q;
>}
>
> This interactive Perl is great
Why is it so great? If it can not interpret
- print "a"; - correctly?
print "a";
a1
--
unix programs: niftp (non-interactive recursive ftp), hide (hide command args),
submit (replace nohup), etc from ftp://ftp.mindspring.com/users/mwang/unix-prog
Michael Wang, mwang@ml.com, Merrill Lynch, World Financial Center, 212-449-4414
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3622
**************************************