[11783] in Perl-Users-Digest
Perl-Users Digest, Issue: 5383 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 14 16:07:26 1999
Date: Wed, 14 Apr 99 13:00:25 -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, 14 Apr 1999 Volume: 8 Number: 5383
Today's topics:
ActivePerl for NT and HTTPS ? <kras@interlog.com>
Re: Another beginner question <cassell@mail.cor.epa.gov>
Re: Best books to use... <cassell@mail.cor.epa.gov>
Re: Best books to use... (Larry Rosler)
Re: CGI / IIS problem (RemarQ User)
Re: Current Date (Abigail)
Re: Database structure for a search engine (Benjamin Franz)
Re: FAQ 1.1: What is Perl? (Marc Haber)
Re: FAQ 1.1: What is Perl? (Larry Rosler)
Re: FAQ 1.5: What is perl6? <wells@cedarnet.org>
Re: FAQ 1.5: What is perl6? (Bart Lateur)
Re: flocking question - worried (Benjamin Franz)
Re: getting mm/dd/yy from localtime() <Allan@due.net>
Re: getting mm/dd/yy from localtime() <emschwar@rmi.net>
Re: getting mm/dd/yy from localtime() (Abigail)
Re: getting mm/dd/yy from localtime() (Larry Rosler)
HELP: PERL construct <durai@gotmail.eng.sun.com>
Re: how do I match all the "1"s in strings like 231451, (Abigail)
Re: how do I match all the "1"s in strings like 231451, (Larry Rosler)
Interacting with a perl program in execution <syzygy@indigo.ie>
Re: Is it possible to have "..." appear while processin <emschwar@rmi.net>
Re: Is it possible to have "..." appear while processin <wells@cedarnet.org>
Re: mailer script question (Larry Rosler)
Re: need to modify 'discus' scripts/config files <cassell@mail.cor.epa.gov>
Re: Newbie Question: String Manipulation <cassell@mail.cor.epa.gov>
Re: Novice needs learning suggestions <aqumsieh@matrox.com>
Re: Novice needs learning suggestions (Larry Rosler)
Perl vs. OTHER scripting languages ? When/Why to use it <mikeg@slpmbo.ed.ray.com>
problem with push <eslater@frinc.com>
Re: Q: Convert two newlines to \n<p> (Mike Collins)
Re: Q: Convert two newlines to \n<p> <tchrist@mox.perl.com>
Re: Q: Convert two newlines to \n<p> <aqumsieh@matrox.com>
Re: Q: Convert two newlines to \n<p> (Bart Lateur)
Quick DBM Question <mwatkins@promotion4free.com>
send a mail with perl <mpajot@club-internet.fr>
Signal handlers not working in 5.005_03 <macintsh@cs.bu.edu>
Re: Speed of PERL (Daniel Beckham)
Re: Typeglobs broken by threaded perl??? <bbense+comp.lang.perl.misc.Apr.14.99@telemark.stanford.edu>
Re: Typeglobs broken by threaded perl??? (Bruce R Miller)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 14 Apr 1999 18:49:59 GMT
From: Kras Gadjokov <kras@interlog.com>
Subject: ActivePerl for NT and HTTPS ?
Message-Id: <7f2o0k$ngj$1@nnrp1.dejanews.com>
Hey, guys
Does anybody know what additional Perl modules for NT do I need to install in
order to use HTTPS POST/GET? Is it some SSL module?
Thanks!
Kras
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 11:49:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Another beginner question
Message-Id: <3714E325.9E92F0DA@mail.cor.epa.gov>
ibrew wrote:
>
> I get an error on the following chunck of code taken directly from the
> "Learning Perl" book, pages 8-9
>
> !#c:/perl/bin/perl
> @words = qw(camel llama alpaca);
>
> I get a compile error on the second statement;
> "Can't modify not in scalar assignment on line two..."
>
> i would be thankful for any help.
Your first line is the problem. It's not !# but #! at thestart of the
line. That's why it's called the 'shebang'.
HTH,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Wed, 14 Apr 1999 12:01:58 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Best books to use...
Message-Id: <3714E626.6F0DC406@mail.cor.epa.gov>
Doug Crabtree wrote:
>
> I am new to perl, and am wondering where to start. I have bought a book
> called "Perl5 by example (David Medinets)". It seems to be a book that will
> give me a good foundation for basic use. I have heard good things and bad
> things about Randall's "Learning Perl (2nd ed.)".
If you're just learning your first computer language, Randal's [note:
only one 'l' in there] book may not be the optimal choice. It assumes
some exposure to programming: concepts like array, subroutine, ...
It's also a bad book if you have absolutely no sense of humor. You will
just get grumpy wondering why other people think it's clever. :-)
I'm not familiar with 'Perl5 by Example', but you might look into
'teach Yourself Perl in 21 Days' if you feel 'Learning Perl' is too
advanced.
> What is a good secondary book to get to become a more advanced programmer in
> perl? Is it Randall's book?
It really depends on your starting point and your goals. What do you
want to do with your future Perl expertise?
> TIA,
> Dug (no use for redundant lettering)
David [no need for redundant lettering with a well-chosen name :-]
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Wed, 14 Apr 1999 12:36:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Best books to use...
Message-Id: <MPG.117e8e23b9c04e629898b0@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <m1g1632itv.fsf@halfdome.holdit.com> on 14 Apr 1999 10:49:32
-0700, Randal L. Schwartz <merlyn@stonehenge.com> says...
> >>>>> "Doug" == Doug Crabtree <not@gonna.tell> writes:
>
> Doug> I am new to perl, and am wondering where to start. I have
> Doug> bought a book called "Perl5 by example (David Medinets)". It
> Doug> seems to be a book that will give me a good foundation for basic
> Doug> use. I have heard good things and bad things about Randall's
> Doug> "Learning Perl (2nd ed.)".
>
> I was gonna ask you in private "what bad things", but you mangled your
> return address. Please don't do that.
You forgot to complain about his also mangling your name. Are you going
soft, or what? :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Apr 1999 10:16:14 -0800
From: oekilla@aol.com (RemarQ User)
Subject: Re: CGI / IIS problem
Message-Id: <T_4R2.22$ce.8520@WReNphoon3>
You too?
I gave up and downloaded APACHE WEB SERVER FOR WIN32 from apache.org. I also
bought the Apache for Windows Black Book. It feels real good to have a cgi
script finally work.
I was up and running in less than 15 minutes....
-**** Posted from RemarQ, http://www.remarq.com/?a ****-
Search and Read Usenet Discussions in your Browser - FREE -
------------------------------
Date: 14 Apr 1999 18:12:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Current Date
Message-Id: <7f2lr3$9hp$1@client2.news.psi.net>
Terra Landry (terral@cyberplex.com) wrote on MMLII September MCMXCIII in
<URL:news:7f2dfn$45b$1@bignews.fundy.net>:
<> I know this has nothing to do with perl, but I'm hoping someone can help me
<> anyway...
<>
<> Thanks, and sorry that this isn't a perl question..
Please ask any non-Perl related questions in sci.desert.penguins.warfare.
As you know, there are only 2 Usenet groups, clpm for Perl topics, and
sdpw for everything else.
Abigail
--
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
------------------------------
Date: Tue, 13 Apr 1999 19:18:16 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Database structure for a search engine
Message-Id: <YLMQ2.700$MQ1.8146@typhoon-sf.pbi.net>
In article <7f01b5$ctg$1@nnrp1.dejanews.com>,
howitgolook <howitgolook@my-dejanews.com> wrote:
>Can anyone suggest a database structure I should use if I am writing a search
>engine?
>
>I wish to record URL, Date Modified, Title, Keywords, Description, and
>possibly some or all of the text on the page.
>
>Should I use text files to store the data? What database structure would
>facilitate efficient (fast!) searching?
You didn't indicate how many (presumably web pages) things you are going
to be storing in your system. Up to about 1,000 a flat search is fast enough.
Beyond that you will want to look into inverted indexes.
--
Benjamin Franz
------------------------------
Date: Wed, 14 Apr 1999 18:28:01 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: FAQ 1.1: What is Perl?
Message-Id: <7f2mnh$ao2$6@news.rz.uni-karlsruhe.de>
stanley@skyking.OCE.ORST.EDU (John Stanley) wrote:
>Instead of splitting the FAQs up into little pieces and stuffing them
>onto the net in dribs and drabs, can you please just post the updated
>FAQs whole?
The idea is to make Newbies searching DejaNews or their local spool
find something in the subject.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: Wed, 14 Apr 1999 12:33:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: FAQ 1.1: What is Perl?
Message-Id: <MPG.117e8d571e7ef7b79898af@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed to perlfaq-suggestions@perl.com.]
In article <7f17c4$d6k$1@news.NERO.NET> on 14 Apr 1999 04:59:48 GMT,
John Stanley <stanley@skyking.OCE.ORST.EDU> says...
> In article <371409aa@cs.colorado.edu>,
> Tom Christiansen <perlfaq-suggestions@perl.com> wrote:
> >(This excerpt from perlfaq1 - General Questions About Perl
>
> Instead of splitting the FAQs up into little pieces and stuffing them
> onto the net in dribs and drabs, can you please just post the updated
> FAQs whole? It is so much more convenient to have them in the original
> nine parts and not have to try to repack them. It saves a lot of space
> from duplicated headers and allows them to be archived and available
> upon request instead of mailed around the world in tiny bits.
I, for one, appreciate gettimg the FAQs in quickly re-readable short
pieces.
If we can assume that as FAQs are updated, they are uploaded to
http://www.perl.com/ or http://www.perl.org/ , then there is easy access
to them as packed units.
I hope Tom will consider this, if he hasn't already.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Apr 1999 19:23:15 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: FAQ 1.5: What is perl6?
Message-Id: <3714EB23.1263D4F8@cedarnet.org>
Tom Christiansen wrote:
>
> (This excerpt from perlfaq1 - General Questions About Perl
> ($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
> part of the standard set of documentation included with every
> valid Perl distribution, like the one on your system.
> See also http://language.perl.com/newdocs/pod/perlfaq1.html
> if your negligent system adminstrator has been remiss in his duties.)
>
> What is perl6?
>
> Perl6 is a semi-jocular reference to the Topaz project. Headed by
> Chip Salzenberg, Topaz is yet-another ground-up rewrite of the
> current release of Perl, one whose major goal is to create a more
> maintainable core than found in release 5. Written in nominally
> portable C++, Topaz hopes to maintain 100% source-compatibility
> with previous releases of Perl but to run significantly faster and
> smaller. The Topaz team hopes to provide an XS compatibility
> interface to allow most XS modules to work unchanged, albeit
> perhaps without the efficiency that the new interface uowld allow.
^^^^^
Since you're putting this in as part of the FAQ I figured I'd point out the
typo. Tom, we all appreciate your work and I for one have found it to be
invaluable in my perl experiences.
Thanks,
STEVE
--
-----------
Stephen D. Wells
http://expert.cc.purdue.edu/~bgannon/booksearch/
http://www.iren.net/wellss/
------------------------------
Date: Wed, 14 Apr 1999 19:53:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: FAQ 1.5: What is perl6?
Message-Id: <3715f119.3432098@news.skynet.be>
Tom Christiansen wrote:
> Written in nominally
> portable C++, Topaz hopes to maintain 100% source-compatibility
> with previous releases of Perl but to run significantly faster and
> smaller.
Wow, there's a novel idea: a C++ program that is both smaller and faster
than the equivalent C code. :-)
Bart.
------------------------------
Date: Wed, 14 Apr 1999 13:08:29 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: flocking question - worried
Message-Id: <hr0R2.1417$MQ1.11163@typhoon-sf.pbi.net>
In article <3711e02f.4191045@news.planet.eon.net>,
<NOSPAMcrstlblu@planet.eon.net> wrote:
>Totally amazing! 20 people thread a Q about flocking - ("it was in the header,
>regardless of content!") - and NOBODY SHOWS US FISH THE ANSWER!
>
>I'm not shouting I'm emphasizing :)
>
>Simple Question:
>gotto have many people changing data in ONE LITTLE DBM file
>it's got 2 copies by the way for some reason (?.pag, and a ?.dir file)
>it will be DAMAGED from SIMULTANEOUS modifications by many
>so WHAT GETS FLOCKED?
>a) the "dbname.pag" file? or the
>b) "dbmname.dir" file??
Neither. You are asking the wrong question.
>in the
>dbmopen(%assarr,"dbmname",0666) command,
>
>neither the PAG or DIR files are SPECIFIED !?!?!? WhyNot?
Because that is the way it is.
>
>dbmclose(%assarr)
>
>can "FLOCK" be used by calling the "DBMNAME" by itself?
>eg: flock "dbmname",2; #lock the dbm
> flock "dbmname",8; #UNlock the dbm
No. This won't work.
>or must one use the FULL NAME ?
>eg: flock "dbmname.DIR",2; or,
> flock "dbmname.PAG",8; ????
No. This won't work, either. 'flock' works on
_file handles_ - not _file names_.
>One last DBM question, between the dbmOPEN, and the dbmCLOSE,
>an ASSOCIATIVE ARRAY %assarr will be commanded to be EQUAL TO i
>SOMETHING
>eg:
>$fields{'email'}="$fields{'something'}::$fields{'somethingelse'}::$fields{'anythingelse'}";
>
>I read that ANYTHING DONE TO THE ASSOCIATIVE ARRAY, the SAME IS
>done to the DBM file ---------- BUT WHEN ?!?!?!?!?!?
>
>ie: $newkey="$thekeyscontent"; ? the moment this is run?
>or dbmclose(%assarr); ? the moment the DBM is CLOSED?
>
>Thank you for your time. I hope that the above questions/examples
>now properly asked, if ANSWERED insightfully piece by SEPERATE
>piece should elleviate a plethora of questions about dbm's and
>flocking and/or locking for centuries to come! ;)
The answer is: Don't use 'dbmopen/dbmclose' if you want to use
file locking. Use GDBM_File or DB_File via 'tie' and use either
GDBM's built in locking support (for GDBM_File) or the method
documented in the DB_File (for DB_File) perldocs to do it.
And don't forget to 'sync' before unlocking.
--
Benjamin Franz
------------------------------
Date: Wed, 14 Apr 1999 14:44:44 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: getting mm/dd/yy from localtime()
Message-Id: <7f2n9f$hs6$1@camel18.mindspring.com>
RemarQ User wrote in message ...
:I'm looking at page 185 of the famous 'Programming Perl', but the localtime
:function hasn't sunk in yet. I need the current date with the mm/dd/yy
:format.
What they hey, here you go. Adding 0s if needed left as an exersize for the
poster.
my $date = join('/',map{$i++;$i==1?$_+1:$_}(localtime)[4,3,5]);
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
The beginning of wisdom is the definitions of terms.
- Socrates
------------------------------
Date: 14 Apr 1999 13:03:30 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: getting mm/dd/yy from localtime()
Message-Id: <xkfaewbm3ct.fsf@valdemar.col.hp.com>
"Allan M. Due" <Allan@due.net> writes:
> What they hey, here you go. Adding 0s if needed left as an exersize for the
> poster.
>
> my $date = join('/',map{$i++;$i==1?$_+1:$_}(localtime)[4,3,5]);
No.
perldoc -f localtime to find out why.
Hint: what's that going to print out next year?
-=Eric
------------------------------
Date: 14 Apr 1999 19:36:11 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: getting mm/dd/yy from localtime()
Message-Id: <7f2qnb$b4o$1@client2.news.psi.net>
RemarQ User (oekilla@aol.com) wrote on MMLII September MCMXCIII in
<URL:news:IA4R2.3982$36.1103454@WReNphoon2>:
## I'm looking at page 185 of the famous 'Programming Perl', but the localtime
## function hasn't sunk in yet. I need the current date with the mm/dd/yy
## format.
##
## Where do i look next?
(s)printf
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Wed, 14 Apr 1999 12:44:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: getting mm/dd/yy from localtime()
Message-Id: <MPG.117e8fe9a52d867f9898b1@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <IA4R2.3982$36.1103454@WReNphoon2> on Wed, 14 Apr 1999
09:51:52 -0800, RemarQ User <oekilla@aol.com> says...
> I'm looking at page 185 of the famous 'Programming Perl', but the localtime
> function hasn't sunk in yet. I need the current date with the mm/dd/yy
> format.
>
> Where do i look next?
Build it yourself, using sprintf on the array outputs, or using substr
on the scalar output.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Apr 1999 12:04:35 -0700
From: durai <durai@gotmail.eng.sun.com>
Subject: HELP: PERL construct
Message-Id: <3714E6C3.F76C58F1@gotmail.eng.sun.com>
Hi,
I am trying to get the equivalent of the following in perl..
nawk "/COMMENT_BEGIN/,/COMMENT_END/" $1
This will return the lines between the two tags inclusive.
Thanks,
durai.
------------------------------
Date: 14 Apr 1999 19:45:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: how do I match all the "1"s in strings like 231451,3132414131,etc?
Message-Id: <7f2r84$b4o$2@client2.news.psi.net>
SAM (same@minspring.com) wrote on MMLII September MCMXCIII in
<URL:news:7f2kkt$4ub$1@camel29.mindspring.com>:
.. Hello,
.. Here is a newbie question on perl re.
.. How do I match a minimum of 2 and a maximum of 4 "1"s in strings like
.. 2312312134
.. 56132141313416512
..
/^(?:[^1]*1){2}(?:[^1]*1){,2}[^1]*$/
Abigail
--
perl -wlpe '}$_=$.;{' file # Count the number of lines.
------------------------------
Date: Wed, 14 Apr 1999 12:52:54 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how do I match all the "1"s in strings like 231451,3132414131,etc?
Message-Id: <MPG.117e91f4fe2f7abc9898b2@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7f2kkt$4ub$1@camel29.mindspring.com> on Wed, 14 Apr 1999
13:52:08 -0400, SAM <same@minspring.com> says...
> Here is a newbie question on perl re.
Far from a trivial question, though.
> How do I match a minimum of 2 and a maximum of 4 "1"s in strings like
> 2312312134
> 56132141313416512
>
> I used the following re
>
> $String =~ /[1]{2,4}/g;
>
> but this seem to match only successive occurances of "1"s.
/^(?:[^1]*1){2,4}[^1]*$/
But trivial enough that I don't have to break it apart and comment it, I
hope.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Apr 1999 20:25:34 +0100
From: Peter Doyle <syzygy@indigo.ie>
Subject: Interacting with a perl program in execution
Message-Id: <3714EBAE.C66DD3A5@indigo.ie>
Hi,
I have program which requires a large file to be loaded and turned into
a hash every time an operation is to performed. I want to have this hash
in memory at all times and have the operations performed through cgi.
The problem is a new instance of the hash has to be made every time the
request comes in. Can I not have a process running which contains the
hash and answer the requests???
Any ideas?
P
------------------------------
Date: 14 Apr 1999 12:38:50 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <xkfg163m4hx.fsf@valdemar.col.hp.com>
mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:
> Bart Lateur <bart.lateur@skynet.be> wrote:
> >You could always print to STDERR, as that is unbuffered by default.
>
> Nope. At least under Unix, it's unbuffered iff it's going to a terminal.
> Just the same as STDOUT.
*sigh*
There Is More Than One Flavor Of Unix(tm).
On at least one currently popular flavor, STDOUT is line-buffered if
going to a terminal, and block-buffered if not. STDERR is *usually*
unbuffered, but you can't always count on that. $| is your friend. Use
it well.
-=Eric
------------------------------
Date: Wed, 14 Apr 1999 19:06:02 +0000
From: Steve Wells <wells@cedarnet.org>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <3714E71A.6BBADD2C@cedarnet.org>
Bart Lateur wrote:
>
> Steve Wells wrote:
>
> >Poohba wrote:
> >
> >> Okay...I do know how to write to the screen but i don't know how to "..."
> >> while the program is running.
> >
> >Depends on your code. After you turn off buffering and you can write back
> >to the screen, you need to look carefully at the code. If it runs in a loop
> >then just have it print "." as part of the loop...
> >
> >while (...something...) {
> > print ".";
> >}
>
> Indeed. Buffering may be the reason why a simple solution doesn't seem
> to work.
At first I took this problem to be a buffering problem and gave several
solutions to that. When Poohba sent back this message I figured that
maybe I had read too deeply into the situation.
*shrug* It's good to know someone else did the same thing. ;-)
STEVE
--
-----------
Stephen D. Wells
http://www.iren.net/wellss/
http://expert.cc.purdue.edu/~bgannon/booksearch/
------------------------------
Date: Wed, 14 Apr 1999 10:55:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: mailer script question
Message-Id: <MPG.117e7654afbd67909898ae@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <3714ba77.0@newsread3.dircon.co.uk> on 14 Apr 1999 16:55:35 -
0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
> Tim Herzog <therzog@knotech.com> wrote:
> > Go to www.worldwidemart.com and look for formmail. It's a Perl/CGI script
> > that's a front end interface to sendmail, and you can tweak it to do what
> > you want.
>
> You recommended him to use what ? And you didnt tell him *not* to come
> back here when he has problems with it ;-}
Actually, it works -- provided you don't 'fix' it ny adding the '-w'
flag and 'use strict;'! I aimed someone who knows no Perl at it, and he
got it to run from his website in no time.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Apr 1999 11:18:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: need to modify 'discus' scripts/config files
Message-Id: <3714DC0C.89EF0F2B@mail.cor.epa.gov>
parv wrote:
>
> has anybody tried to modify the 'discus' (a threaded/linear www
> discussion board) scripts & configuration files? most of the
> modification will involve to make the dynamically generated html to
> conform to html 4 & css as closely as possible.
>
> of course, i could sit for few hours, and do it myself...but, then,
> being lazy is one of three virtues of a perl programmer. don't you just
> want to just love larry!
>
> - parv
Errm.. I don't know Larry that well. And Gloria might have something
to say about it too.
But when Larry said that laziness is the first great virtue of a
programmer, he meant "the quality that makes you go to great effort
to reduce overall energy expenditure." Not the quality that makes
you go to *no* effort to reduce your personal energy expenditure
while increasing overall energy expenditure for everyone else. :-)
Also, it is highly likely that most people on this newsgroup have
never seen discus. I haven't - but that doesn't mean much.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Wed, 14 Apr 1999 12:50:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Newbie Question: String Manipulation
Message-Id: <3714F171.6DF1A17@mail.cor.epa.gov>
Tim Herzog wrote:
>
> In article <7f25mq$phm$1@clarknet.clark.net>, "Aaron Glahe"
> <glahea@wwdsi.com> wrote:
>
> >I am using Perl 5.005
> >
> >I have a string
> >
> >$cgi1 = "GET /cgi-bin/test?xxxxx"
> >
> >I would like to strip out the first and last part and have "test" be left.
> >How would I do that. I do not want to depend on looking for "test", but
> >would rather
> >strip off "GET /cgi-bin/" and "?xxxx"
> >
> >Thanks in advance.
>
> $cgi1 =~ s/GET \/.*\/.*\?(.*)/$1/;
>
> or to make it more readable:
>
> $cgi1 =~ s|GET /.*/.*\?(.*)|$1|;
>
> Since that first ".*" is greedy, it will match
>
> GET /cgi-bin/test?xxxxx
>
> as well as:
>
> GET /cgi-bin/subdir/subdir/subdir/test?xxxxx
>
> --
> Tim Herzog
Ummm, I think you made a braino there, Tim. Your regex is going to
match 'xxxxx' instead. Try it. Perhaps
$cgi1 =~ s#.*/(.*?)\?.*#$1#;
is more what he had in mind. {Match everything to last `/', non-greedy
grab up to next `?' in case there are more `?' following, and eat the
rest.}
However, IMHO, for general parsing of html, you're better off going to
HTML::Parser and letting the module do the dirty work.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Wed, 14 Apr 1999 14:43:10 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Novice needs learning suggestions
Message-Id: <x3y676zavr5.fsf@tigre.matrox.com>
"Michael Villeneuve" <mickv@home.com> writes:
> Here's how it's done:
> 1) Buy a good book on Perl (O'reilly has a couple)
^^^^^^
If by "couple" you mean "two", then you are wrong. O'Reilly has at
least 5 good books on Perl.
If by "couple" you mean "several", then you are wrong again, as my
webster dictionary defines "couple" as:
2. Two of the same kind connected or considered together; a
pair; a brace.
yeah yeah .. I am a pain in the butt sometimes :-)
------------------------------
Date: Wed, 14 Apr 1999 12:57:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Novice needs learning suggestions
Message-Id: <MPG.117e931ebf4b5a409898b3@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <x3y676zavr5.fsf@tigre.matrox.com> on Wed, 14 Apr 1999
14:43:10 -0400, Ala Qumsieh <aqumsieh@matrox.com> says...
> "Michael Villeneuve" <mickv@home.com> writes:
> > Here's how it's done:
> > 1) Buy a good book on Perl (O'reilly has a couple) ^^^^^^
>
> If by "couple" you mean "two", then you are wrong. O'Reilly has at
> least 5 good books on Perl.
> If by "couple" you mean "several", then you are wrong again, as my
> webster dictionary defines "couple" as:
>
> 2. Two of the same kind connected or considered together; a
> pair; a brace.
No, you are wrong. I know because I had my nose rubbed in it by this
newsgroup a few weeks ago.
4. An indefinite small number : FEW
> yeah yeah .. I am a pain in the butt sometimes :-)
Regardless...
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Apr 1999 10:55:40 -0400
From: Michael Genovese <mikeg@slpmbo.ed.ray.com>
Subject: Perl vs. OTHER scripting languages ? When/Why to use it ?
Message-Id: <3714AC6C.967940A5@slpmbo.ed.ray.com>
Hello:
I've been asked by my manager to come up with reasons, arguments,
and/or guidelines for choosing one scripting language over another.
Our group is a modest-sized TOOLS group in a large company.
We have scripts in the following :
* AWK (and NAWK)
* C SHELL
* KORN SHELL
* PERL
* TCL
I'm a PERL fan.
I know C SHELL a bit, but find PERL much easier to handle.
My manager is definately a C SHELL fan, doesn't know PERL and doesn't
really have the time to learn it. In point of fact, he's a C SHELL expert.
He recently decided that we WILL do our scripts in C-SHELL & AWK/NAWK,
but is now willing to modify his position if I can come up with
compelling arguments to do otherwise.
Suggestions, people ?
I'm not saying PERL should be used for ALL scripts.
But I do think that any script of any size and/or complexity is
probably better off in PERL than in C-SHELL and/or AWK/NAWK.
--
Mike Genovese, Sr. S/W Engineer
Software Engineering Laboratory, Raytheon, Marlborough, MA
508-490-3891
My opinions are my own, and not necessarily those of my employer.
------------------------------
Date: Wed, 14 Apr 1999 15:15:03 -0400
From: "Elliot Slater" <eslater@frinc.com>
Subject: problem with push
Message-Id: <7f2pgq$1pj$1@nntp2.uunet.ca>
Here is code snipet:
$MckShared = "c:\perl\modules\";
$_ = "$MckShared";
s/\\/\\\\/g;
$MckShared = $_;
push(@INC, $MckShared);
Problem is it is not finding the module in the MckShared directory and the
script wont compile. I cant figure it out. I look in a Perl Book I have
and the push looks identical.
Any help is appreciated.
Elliot Slater
------------------------------
Date: Wed, 14 Apr 1999 18:07:45 GMT
From: mike@w3z.com (Mike Collins)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <3715d772.3416594@news.netway.com>
Gentlemen, thanks for your help. The substitution I tried while
attempting to convert \n\n to \n<p> was hampered by the monkey wrench
effect. The text file, as noted below, was sent to a Unix server from
Win32 through a file upload form that uses Cgi.pm. The problem had me
perplexed because the was not where I expected it to be.
Thanks again.
Mike Collins
On 14 Apr 1999 07:54:24 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:
>In comp.lang.perl.misc, bart.lateur@skynet.be (Bart Lateur) writes:
>:Getting rid of all "\r" may be a safe idea, in any case.
>: tr/\r//d;
>
>Oh good. You're on a Mac, and you've just deleted all the linefeeds.
In response to Tim Herzog, 14 Apr 99, at 9:11:
Thanks for your interest in this. I tried the code shown below several
times but it didn't work. The code works but as you suspected the
problem was elsewhere. The text file object was uploaded from Win32 to
a Unix server via Cgi.pm file upload. That changed the end of record
markers.
So, I only need to get that part of my regex right (\r\n ?) and I'm
all set.
Thanks for your help.
> This was bugging me, so I checked it out. Here's the script I wrote:
> if( open INPUT, "Soren:input.txt" ) {
> $all = join "", <INPUT>;
> close INPUT;
>
> $all =~ s/\n\n/<p>\n/g;
> print $all;
> }
> I tried it with s///sg and s///g, and it didn't make any difference. Could
> the problem possibly lie elsewhere? Perhaps you're running Win32, and the
> 2-byte CR's are screwing it up (I'm running on MacOS and Linux).
------------------------------
Date: 14 Apr 1999 13:00:15 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <3714e5bf@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, abigail@fnx.com writes:
:Whenever I see someone write '\r\n', I wonder if they know
:what they are talking about.
Stop wondering. You know the answer. :-(
--tom
--
"That which does not kill me makes me stranger." --Larry Wall
------------------------------
Date: Wed, 14 Apr 1999 14:36:27 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <x3y7lrfaw2e.fsf@tigre.matrox.com>
therzog@knotech.com (Tim Herzog) writes:
> In article <3713f2cf.15977653@news.netway.com>, mike@w3z.com (Mike
> Collins) wrote:
>
> >Trying to match two newlines to produce one newline and a paragraph
> >tag <p>.
> >
> >The code shown and many, many variations all fail.
> >
> >undef $/;
> >while (<TXTFILE>){
> > s/\n\n/\n<p>/sg; #Not even close!
> > print;
> >}
This works fine for me. What results are you getting?
Note that the /s modifier is useless there.
% cat txt
this is a line
and another
and one more
% perl -w
open TXTFILE, "txt" or die "$!";
undef $/;
while (<TXTFILE>){
s/\n\n/\n<p>/g;
print;
}
__END__
this is a line
<p>and another
<p>and one more
<p>
> undef'ing the globals doesn't work very well. Try this instead:
Who told you so? What do you mean by "doesn't work very well"? Does it
partially work? Does it work in a bad way?
I do it all the time, and I never got any problems.
> $everything = join("", <TXTFILE>);
This is extremely slow compared to undef()ing $/.
> $everything =~ s/\n\n/\n<p>/sg;
Again, the /s modifier is useless.
HTH,
Ala
------------------------------
Date: Wed, 14 Apr 1999 19:46:32 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Q: Convert two newlines to \n<p>
Message-Id: <3714f062.3249857@news.skynet.be>
Ala Qumsieh wrote:
>open TXTFILE, "txt" or die "$!";
>undef $/;
>while (<TXTFILE>){
> s/\n\n/\n<p>/g;
> print;
>}
Funny that, a while loop. While it's body will be executed only ONCE.
Bart.
------------------------------
Date: Wed, 14 Apr 1999 18:51:27 +0100
From: "Mike Watkins" <mwatkins@promotion4free.com>
Subject: Quick DBM Question
Message-Id: <uHcpp#ph#GA.347@nih2naac.compuserve.com>
Hi there,
I was just wondering, how reliable are DBM files if using large amounts of
text for one entry. Would everything work ok if I put entire docuements as
entries in a DBM file, or are DBM files for small things like, passwords,
ect...?
Thanks,
Mike
------------------------------
Date: Wed, 14 Apr 1999 21:21:01 +0200
From: "Kevin" <mpajot@club-internet.fr>
Subject: send a mail with perl
Message-Id: <7f2po6$8sq$1@front2.grolier.fr>
Hi all,
I've included some code in a program which runs properly, but it doesn't
work anymore...
Here are the lines...
open (MAIL, "| mail toto@here.com -s any_subject");
print MAIL "coucou";
close (MAIL);
Is there any reason?
Could you give me an other solution to send email with the receiver and the
suject in the command line...
Thanks.
------------------------------
Date: 14 Apr 1999 18:27:29 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Signal handlers not working in 5.005_03
Message-Id: <7f2mmh$fop$1@news1.bu.edu>
Signal handers just don't want to work on my system. The script
included below runs fine in 5.004 but chokes in 5.005_02 and 5.005_03 on
my system. Is there some new way this should be done in 5.005, or is
this a bug?
When I run this script and then suspend it, I can never resume. It just
chucks me back out again, as if the signal never gets cleared from the
queue after it's handled.
---
#!/usr/local/bin/perl
for(;;)
{
eval
{
$SIG{'TSTP'} = sub { die "suspended" };
print "> ";
$res = <STDIN>;
$SIG{'TSTP'} = 'DEFAULT';
};
if($@ =~ /^suspended/)
{
$SIG{'TSTP'} = 'DEFAULT';
kill 'TSTP', $$;
print "\n";
redo;
}
elsif($@) { die "Eval error: $@" }
exit if($res =~ /^q/i);
}
---
Here's a sample run:
---
% signal-test.pl
> ^Z
Suspended
% fg
signal-test.pl
Suspended
% fg
signal-test.pl
Suspended
% fg
signal-test.pl
Suspended
%
---
...and so on, until I kill the process. The number of newlines between
each "fg" and when I get the prompt back varies wildly, sometimes
spewing for pages.
My setup is as follows:
---
% uname -a
SunOS csa 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-4
% perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris-thread
uname='sunos csa 5.6 generic_105181-12 sun4u sparc '
hint=recommended, useposix=true, d_sigaction=define
usethreads=define useperlio=undef d_sfio=undef
Compiler:
cc='gcc -B/usr/ccs/bin/', optimize='-O', gccversion=2.8.1
cppflags='-D_REENTRANT -I/usr/local/include'
ccflags ='-D_REENTRANT -I/usr/local/include'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lposix4 -lpthread -lc -lcrypt
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under solaris
Compiled at Apr 14 1999 13:42:36
@INC:
/home/alumni/macintsh/Lib
/usr/local/lib/perl5/5.00503/sun4-solaris-thread
/usr/local/lib/perl5/5.00503
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread
/usr/local/lib/perl5/site_perl/5.005
---
I hope someone can help! Thanks.
-----------------+----------------------------------------
John Siracusa | If you only have a hammer, you tend to
macintsh@bu.edu | see every problem as a nail. -- Maslow
------------------------------
Date: Wed, 14 Apr 1999 14:26:06 -0500
From: danbeck@scott.net (Daniel Beckham)
Subject: Re: Speed of PERL
Message-Id: <MPG.117ea7c8a7cec2b198968b@news.idt.net>
HA! Funny.
In article <lngbe7.0pv.ln@magna.metronet.com>, tadmc@metronet.com says...
> David L. Cassell (cassell@mail.cor.epa.gov) wrote:
>
> : My version of Net::ESP isn't
> : working now.
>
>
> I knew that.
>
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
>
------------------------------
Date: 14 Apr 1999 18:13:24 GMT
From: <bbense+comp.lang.perl.misc.Apr.14.99@telemark.stanford.edu> ;
Subject: Re: Typeglobs broken by threaded perl???
Message-Id: <7f2ls4$n7c$1@nntp.Stanford.EDU>
In article <7evm1g$lrg$1@news.nist.gov>,
Bruce R Miller <bruce.miller@nist.gov> wrote:
>In article <7evjv5$rk0$1@nntp.stanford.edu>,
> <bbense+comp.lang.perl.misc.Apr.13.99@telemark.stanford.edu> ; writes:
>>In article <7eiha8$3fq$1@news.nist.gov>,
>>...
>>>But any reusable piece of code that mungs with $_, either has to bind it,
>>>or advertise it, anyway... threads or no.
>>
>>- - I think there is a problem with the statement
>>
>>"But any reusable piece of code that mungs with $_"
>>
>>It's pretty much an oxymoron in my book. Reusable code
>>does not mung with $_.
>
>You go a bit further than I would, but I think we agree in the general
>sentiment...
- - Mung to my mind implies 'explict writing' to $_ or expecting it to remain
unchanged outside the current scope. Reading it is somewhat acceptable.
I like having a language powerful enough to play such games, however
I think people that put that kind of stuff in code other people have
to maintain are the modern day equivalent of horse thieves. Hanging
is too easy a death....
>Which still leaves the question: What's the change in treatment of $_
>supposed to be saving us from?
- - Global variables and threads don't play nice. I think the design
change follows the principal of least suprise. If you use $_ as a
read-only variable in the local scope, ( like 99% of the existing
perl code does ) , you won't see any difference btw thread-enabled
and unthreaded perl.
- - The problem arises when you actually try and use threads. If $_
is global, chaos ensues when you attempt to use $_ in the usual
manner. Some change in the behaviour of $_ is required. I think
the current solution is pretty good. I haven't run across any
code in my threading experiments that doesn't behave the way
I think it should. I use a thread-enabled perl as my day to
day perl on my workstation without any wierd results.
- - Booker C. Bense
Version: 2.6.2
iQCVAwUBNxTavwD83u1ILnWNAQH5OAP/QVuNC/vzzrN2vIgorTfSE3VRxzrEtIQ9
2KJHTo66DG1DIr5h2jfoXlSioQxDpP8Wwe6Ok0YPjlKKuka/drpvJdLRSTBGimnW
BHRZocoWtAsYHnljsBeOqldwgTxPSqQwrI/PuBvva/3YGw4kgho5Xd/LkCKZT7j9
+BnrqHtg7q4=
=9tmo
-----END PGP SIGNATURE-----
------------------------------
Date: 14 Apr 1999 19:21:59 GMT
From: miller@altaira.cam.nist.gov (Bruce R Miller)
Subject: Re: Typeglobs broken by threaded perl???
Message-Id: <7f2psn$pe0$1@news.nist.gov>
In article <7f2ls4$n7c$1@nntp.stanford.edu>,
<bbense+comp.lang.perl.misc.Apr.14.99@telemark.stanford.edu> ; writes:
[...]
>- - Global variables and threads don't play nice. I think the design
>change follows the principal of least suprise. If you use $_ as a
>read-only variable in the local scope, ( like 99% of the existing
>perl code does ) , you won't see any difference btw thread-enabled
>and unthreaded perl.
Hmm, most of the (non-library) code I've looked at treats $_ as something
to be eaten from, rather than just read; lots of stuff like
s/^patterns// && do something($1...)
'Course maybe I've been looking at the wrong code..:>
Not that I'm advocating it either... sometimes you just inherit
questionable software...
>- - The problem arises when you actually try and use threads. If $_
>is global, chaos ensues when you attempt to use $_ in the usual
>manner.
If the threads dont want to share $_, can't they just put a
local($_)
somewhere near the beginning of each thread? Then each thread would
see its own binding of $_ ??
Or not? Maybe I'm thinking too lispy? (been known to happen!)
--
--
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/
------------------------------
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 5383
**************************************