[10965] in Perl-Users-Digest
Perl-Users Digest, Issue: 4566 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 6 17:17:20 1999
Date: Wed, 6 Jan 99 14:04:59 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 6 Jan 1999 Volume: 8 Number: 4566
Today's topics:
Re: Adding a path to the @INC variable <jims@broadcom.com>
Re: Can't find my way with a map <d-edwards@nospam.uchicago.edu>
Re: Checking for a Charictor in a Variable (brian d foy)
Re: Checking for a Charictor in a Variable (Larry Rosler)
couldn't spawn process error <simsi@hotmail.com.nospam>
Databases Help <nic_azzuri@compuserve.com>
Re: Does 'require' run the script automatically? (Alister)
Re: Dynamic gifs on the fly mark_thomas@my-dejanews.com
Re: Embedding PERL in C & also C in PERL (Edwin Litterst)
HELP - Is it possible to read mail from an Exchange Ser qvanegeren@frxsoft.com
Help reading/rewriting file jdennis@alldata.net
how do you pass a query string while debugging in dos? (jm)
Re: how do you pass a query string while debugging in d <rhw@lucent.com>
Re: how do you pass a query string while debugging in d <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: If Larry Wall's listening out there.... <dennis.kowalski@daytonoh.ncr.com>
Re: If Larry Wall's listening out there.... (Peter Scott)
Looking for module to calculate shipping rates (Jete Software Inc.)
Re: Nasty regexp .... help! <zack44@altavista.net>
Re: Nasty regexp .... help! (brian d foy)
Re: Nasty regexp .... I'm stumped. ptimmins@netserv.unmc.edu
Need CGI database philipbrown@my-dejanews.com
Need hints on how to use MakeMaker <dwc3q@mamba.cs.virginia.edu>
Re: OK I give up (After a WEEK!) - FIXED! (Marc Austin)
Perl and LDAP <mab@hrb.com>
Perl Criticism topmind@technologist.com
Re: Perl Criticism dturley@pobox.com
Re: Perl Criticism <jeromeo@atrieva.com>
Re: Short way to do this with a regexp?? Delete certain (Tad McClellan)
Re: Short way to do this with a regexp?? Delete certain (Charles Wilt)
Re: Short way to do this with a regexp??....Thanks to A (Charles Wilt)
What happened to mox.perl.com lordkai2@hotmail.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 06 Jan 1999 12:42:11 -0800
From: Jim Searle <jims@broadcom.com>
Subject: Re: Adding a path to the @INC variable
Message-Id: <s7sodo3zh8.fsf@flogger.broadcom.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> Daniel Grisinger <dgris@moiraine.dimensional.com> writes:
> :> BEGIN {
> :> push(@INC,"/some/path/some/where");
> :> }
> :>
> : use lib '/some/path/some/where';
> :is almost exactly equivalent to the begin block you posted above.
I'd perfer to use lib, but I can't seem to get this to work.
BEGIN {
$MyDir = "/path/to/some/dir";
use lib ($MyDir . "/goo");
}
It just end's up with '/goo' added to the path.
But this does work:
BEGIN {
$MyDir = "/path/to/some/dir";
unshift(@INC, $MyDir . "/goo");
}
I assume it's a package problem but I've tried many different ways of
declaring and using the variable and I can't seem to get it to work.
Thanks,
jim
------------------------------
Date: Wed, 6 Jan 1999 19:50:51 GMT
From: Darrin Edwards <d-edwards@nospam.uchicago.edu>
Subject: Re: Can't find my way with a map
Message-Id: <tgemp818pw.fsf@noise.bsd.uchicago.edu>
Jerry Pank <jerryp.usenet@connected.demon.co.uk> writes:
>
> I want to use map to remove leading/trailing quotes that may exist in a
> tab delimited file:
>
> Something along the lines of:
>
> @data = map { s/^"|"$//g; } split /\t/, $line;
>
> What do I need to change so @data is the result of the s/// rather than
> the number of matches?
My first thought here was "capturing parens!", often the answer
when one is trying to get stuff "out" of a pattern match.
Fortunately my brain caught up with my mouth in time, 'cause
that's obviously not right here. You want each element of
@data to be a whole field from the split, i.e. you want each
iteration of map to _return_ the whole string (in this case $_)
that s/// was operating on:
@data = map { s/^"|"$//g; $_ } split /\t/, $line;
Cheers,
Darrin
------------------------------
Date: Wed, 06 Jan 1999 15:54:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Checking for a Charictor in a Variable
Message-Id: <comdog-ya02408000R0601991554410001@news.panix.com>
In article <76vkj1$opn$1@plug.news.pipex.net>, "Artoo" <r2-d2@REMOVEbigfoot.com> posted:
> How can you check to see if a character exists with-in a variable. ie: I
> need to check there is an @ sign anywhere in the variable inorder to
> process.
tr/@//
m/\@/
index($_, '@') > 0
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 6 Jan 1999 13:33:04 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Checking for a Charictor in a Variable
Message-Id: <MPG.10fd76689c92ddb59898f8@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <comdog-ya02408000R0601991554410001@news.panix.com> on Wed,
06 Jan 1999 15:54:41 -0500, brian d foy <comdog@computerdog.com> says...
> In article <76vkj1$opn$1@plug.news.pipex.net>, "Artoo" <r2-d2@REMOVEbigfoot.com> posted:
>
> > How can you check to see if a character exists with-in a variable. ie: I
> > need to check there is an @ sign anywhere in the variable inorder to
> > process.
>
> tr/@//
>
> m/\@/
>
> index($_, '@') > 0
To be semantically equivalent to the other two ways, this should be
index($_, '@') >= 0
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 06 Jan 1999 21:18:55 GMT
From: "Simmo" <simsi@hotmail.com.nospam>
Subject: couldn't spawn process error
Message-Id: <01be39ba$39b64760$79c348c2@is>
Hi,
I hope this is the right place for this...sorry if it's more Unix than Perl
but am not sure as non-Perl scripts appear to run fine and i dont claim to
be a sys-op ;(.
Has anyone seen this error running Perl 5 on FreeBSD latest version:
couldn't spawn child process: /home/xxx/www/cgi-bin/client/logon.pl
The error crops up occassionally but after repeated reloads clears itself.
Any help gratefully received.
Ian
------------------------------
Date: Wed, 6 Jan 1999 20:34:31 -0000
From: "MarcoPolo" <nic_azzuri@compuserve.com>
Subject: Databases Help
Message-Id: <eHZmPebO#GA.131@nih2naac.prod2.compuserve.com>
Im new to perl and want to learn how to get perl to enter details into a
database (access)
is this possible? and how is it done?, and are there any ways it can be done
without CGI?
------------------------------
Date: Wed, 06 Jan 1999 18:57:12 GMT
From: comp.lang.perl.misc--usenet@minotaur (Alister)
Subject: Re: Does 'require' run the script automatically?
Message-Id: <36965fa3.8329760@158.152.254.76>
Rich Grise <off-duty@entheosengineering.com> wrote:
>main.cgi:
> require "/my/real/subdirectory/mysub.cgi";
> &printit("other &stuff");
I would call filenames that are 'require'd .pl, rather than .cgi -
leave that for programs that really are executable, instead of
includes.
Alister
------------------------------
Date: Wed, 06 Jan 1999 19:19:45 GMT
From: mark_thomas@my-dejanews.com
Subject: Re: Dynamic gifs on the fly
Message-Id: <770d0e$qd$1@nnrp1.dejanews.com>
In article <36938BCE.6D5741FC@yahoo.com>,
Leonord Wertzberger <chaimwerz@yahoo.com> wrote:
> Hi thanks for your reply!
> Can you please direct me to the question topic where this was discussed - I
am still very new to
> perl. Also what does DejaNews mean and where can I find it?
Search usenet archives, http://www.dejanews.com
In addition to Image::Magick, you may wish to look up gd.pm
--
Mark Thomas, who just entered his third
printf"%x",34*join('',unpack('C*',"*^'"));
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 19:16:54 GMT
From: el@fiz-karlsruhe.de (Edwin Litterst)
Subject: Re: Embedding PERL in C & also C in PERL
Message-Id: <3693b635.14212252@news>
>Embedding PERL in C and vice-versa seem interesting. Can anyone suggest
>where I can find some introduction to it - some sort of a book......
The man pages are the best source for this.
BTW, does anyone have experience with perl calling c, where the c
module is calling perl again?
I always had problems because it seemed that there was only one perl
interpreter used and data was mixed.
Eddie
------------------------------
Date: Wed, 06 Jan 1999 19:37:25 GMT
From: qvanegeren@frxsoft.com
Subject: HELP - Is it possible to read mail from an Exchange Server using PERL?
Message-Id: <770e1l$1sq$1@nnrp1.dejanews.com>
I had posted a message before about reading e-mail on a win32 platform and
was directed to use NET::POP3, which I did, but the MIS department says they
don't have a POP3 server running. They are instead running Exchange Server.
I can't get the NET::POP3 to work with the Exchange Server. Are there any
other suggestions as to what I can do through PERL to read incoming mail
that comes through an Exchange Server?
Thanks in advance for any suggestions you may have.
Quenten
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 21:31:42 GMT
From: jdennis@alldata.net
Subject: Help reading/rewriting file
Message-Id: <770knv$886$1@nnrp1.dejanews.com>
Sorry for the newbie nature of this post, but I am a relative newbie when it
comes to perl.
I have a file that consists of multiple line HTML records, for lack of a
better term. Each "record" starts with an <H3> tag on the first line. I
need to take this file, read it in, remove the html tags, and write it out to
a flat file, where each field is separated by a pipe sign and each record is
now on one line.
I can read the file fine, and rewrite it to another file. Where I am having
trouble is the syntax to strip out the html, and then how to write the multi
line record to a single line record.
Any help appreciated.
Jamie
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 19:47:39 GMT
From: fatshit@hotmail.com (jm)
Subject: how do you pass a query string while debugging in dos?
Message-Id: <3694bdc0.4045612@news.atl.bellsouth.net>
how do you pass a query string while debugging in dos?
please email to mailto:jminder@bellsouth.net
------------------------------
Date: Wed, 06 Jan 1999 15:06:49 -0600
From: Bob Walters <rhw@lucent.com>
To: jm <fatshit@hotmail.com>
Subject: Re: how do you pass a query string while debugging in dos?
Message-Id: <3693D069.2BD2716B@lucent.com>
I'm having a similar problem in Unix.
>From a browser:
http://........../program.cgi?value
will pass "value" to program.cgi. Running the program directly from
UNIX with a space
program.cgi value
will also pass the value but I'm failing to find how to use the "system"
command to pass the value.
>From within another perl script running:
system "program.cgi", "value";
will execute program.cgi but "value" doesn't get passed to it.
Can anyone help? I haven't found this in any literature thus far.
===================================================================
jm wrote:
> how do you pass a query string while debugging in dos?
>
> please email to mailto:jminder@bellsouth.net
------------------------------
Date: 06 Jan 1999 22:56:34 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: how do you pass a query string while debugging in dos?
Message-Id: <83n23wuktp.fsf@vcpc.univie.ac.at>
Re: how do you pass a query string while
debugging in dos?, Bob <rhw@lucent.com> said:
Bob> I'm having a similar problem in Unix. From a
Bob> browser: http://........../program.cgi?value
Bob> will pass "value" to program.cgi. Running the
Bob> program directly from UNIX with a space
The CGI.pm module does this for you.
Bob> program.cgi value will also pass the value but
Bob> I'm failing to find how to use the "system"
Bob> command to pass the value. From within another
Bob> perl script running: system "program.cgi",
Bob> "value"; will execute program.cgi but "value"
Bob> doesn't get passed to it.
Yes, it does get passed, but as command line
parameters, but that isn't how CGI works. Again,
the CGI.pm module is your friend.
perldoc CGI
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Wed, 06 Jan 1999 14:09:50 -0500
From: Dennis Kowalski <dennis.kowalski@daytonoh.ncr.com>
Subject: Re: If Larry Wall's listening out there....
Message-Id: <3693B4FE.32CD@daytonoh.ncr.com>
>
> I use edit.com in my WINDOWS95/NT environment.
> It gives the line numbers.
O, Well, I just got zonked by two emails about the size of my reply.
Sorry, my mistake.
Somehow I missed the parts of the original message after the 1st
question that I attempted to answer with the 2 lines show above..
Mea Cupa, Mea Cupa, Mea Maxima Cupa
------------------------------
Date: 6 Jan 1999 19:45:04 GMT
From: psl@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: If Larry Wall's listening out there....
Message-Id: <770eg0$g3u@netline.jpl.nasa.gov>
In article <76urmk$ncd$1@news.akl.netlink.net.nz>,
"Andrew Mayo" <andrew@geac.co.nz> writes:
> Has anyone out
> there had experience in maintaining large (>10,000 line) Perl programs or
> program suites, and if so, what techniques would you recommend to maximise
> maintainability, other than the obvious recourse of commenting every line,
> which is currently what I am doing?.
I have created several large Perl suites, including one comprising,
lessee... 8291 LOC, although no-one should confuse LOC with power.
Techniques? Object-oriented. Document - especially POD. Plus
design documents and other docs separate from the code. I have done
similar-sized projects in C and find Perl slightly better for
maintainability (C has no built-in documentation language, although
there are some third party ones out there), just that the LOC shrinks
due to the power of Perl.
> 2. No macro pre-processor (AFAIK) which would let me add a bit of
> syntactic sugar; most experienced C programmers find #define and
> #typedef are invaluable for rendering sense out of chaos.
-P as suggested, or check out the Filter::* modules. But I've never
used them; there are standard ways in Perl of defining constants that
work fine. C++ taught us that using #define for macros was inferior
to _inline_, so I presume you're not referring to that capability :-)
And since there is no strong typing you don't need typedef :-)
I wrote tons of C before coming to Perl, and of course I had to use
the preprocessor liberally, who wouldn't? But I have never missed it
in Perl.
--
This is news. This is your | Peter Scott, NASA/JPL/Caltech
brain on news. Any questions? | (psl@euclid.jpl.nasa.gov)
Disclaimer: These comments are the personal opinions of the author, and
have not been adopted, authorized, ratified, or approved by JPL.
------------------------------
Date: 6 Jan 1999 16:00:08 -0500
From: jete@dgs.dgsys.com (Jete Software Inc.)
Subject: Looking for module to calculate shipping rates
Message-Id: <770iso$55l@dgs.dgsys.com>
this is for an online shopping cart application. I was just wondering
how other people and companies do the shipping rate calculations. Does
any company offer a commericial service or is there simply a perl module
in CPAN (I looked but couldn't find anything there).
This would be a general solution which would accept the following input
variables: carrier (UPS, Fedex, ...), type (2nd day ground, 3rd day, ...),
weight, origin zip and dest zip and output the cost. While I can code
this myself, I would think that there must be a better solution (also I
am worried about the shipping rates quickly going out-of-date).
How are others solving this problem??
Thanks!!
-- Norman
------------------------------
Date: Wed, 06 Jan 1999 14:20:18 -0500
From: Zack <zack44@altavista.net>
Subject: Re: Nasty regexp .... help!
Message-Id: <3693B772.7605360A@altavista.net>
Thanks for the code snippet. (And apologies for posting that question 5 times ..... netscape kept giving me an error when I sent it)
That *would* work, but now for the tougher part, which I forgot to mention in the original: support for wildcards.
ie: a search on "int??net" should match both internet and intranet
a search on auto* should match "autos, automotive, etc"
a search on *motiv* should match "automotive, motive, motivate"
This is where the regexp comes in (I think). In the posted code example, can you put wildcards in with the "exists" ???
Z-
------------------------------
Date: Wed, 06 Jan 1999 15:45:17 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Nasty regexp .... help!
Message-Id: <comdog-ya02408000R0601991545170001@news.panix.com>
In article <3693B772.7605360A@altavista.net>, Zack <zack44@altavista.net> posted:
> ie: a search on "int??net" should match both internet and intranet
are you sure?
#!/usr/bin/perl
$\ = "\n";
foreach( qw(internet intranet innet innuit) )
{
print if /int??net/
}
output is
innet
it's that tricky non-greedy quantifier on the ?, which matches 0 or
1 times normally, but zero times in the non-greedy context. perhaps
you meant
/int..net/
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 06 Jan 1999 19:19:21 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Nasty regexp .... I'm stumped.
Message-Id: <770cvn$q4$1@nnrp1.dejanews.com>
In article <36938EF5.B300CC1C@altavista.net>,
Zack <zack44@altavista.net> wrote:
> I don't know if it's possible to do this in a single expression, but here's
what I've been beating my head against the wall trying to do:
>
> Scan a text string with the following rules:
>
> 1. Some words are "required"
> 2. Other words are "optional"
> 3. Others are to be "screened"
[snip other specs]
Here's a starter:
@req = qw(req1 req2);
@opt = qw(opt1 opt2 opt3);
@screen = qw(screen1 screen2);
$line = 0;
while (<DATA>) {
$n_req = 0; $n_opt= 0; $n_screen = 0;
foreach $req (@req) {
while (/\b$req\b/g) {$n_req++;}
}
foreach $opt (@opt) {
while (/\b$opt\b/g) {$n_opt++;}
}
foreach $scrn (@screen) {
while (/\b$scrn\b/g) {$n_screen++;}
}
print "Line:$line n_req:$n_req n_opt:$n_opt n_scrn:$n_screen\n";
$line++;
}
__DATA__
one screen: screen2 and two optionals: opt3 and another opt3 here
blah blah req1 blah req2 opt3 screen1 blah req2 req1 blah
will print:
Line:0 n_req:0 n_opt:2 n_scrn:1
Line:1 n_req:4 n_opt:1 n_scrn:1
Good luck!
Patrick Timmins
$monger{Omaha}[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 20:21:01 GMT
From: philipbrown@my-dejanews.com
Subject: Need CGI database
Message-Id: <770gjb$4ar$1@nnrp1.dejanews.com>
Does anyone know where I can download a database which
will allow people to upload their names, addresses, phone
numbers, etc to a web site and also allow them to view
the names, addresses, etc of other people who also uploaded
this information? It can use CGI for the server side.
Philip
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 6 Jan 1999 16:18:18 -0500
From: David Coppit <dwc3q@mamba.cs.virginia.edu>
Subject: Need hints on how to use MakeMaker
Message-Id: <Pine.GSO.4.05.9901061613050.21635-100000@mamba.cs.virginia.edu>
I'm pretty sure I want to use MakeMaker for this:
- I want to distribute a script which uses some of my own modules, as well
as several other non-standard Perl ones.
- I want to make sure all the modules are installed correctly. (URI in
particular, since URI-URL isn't supported by my code and causes
"strange" errors for the users.)
- I suppose I ought to do a manifest, and a test or two. :)
MakeMaker seems aimed at modules, not scripts. Can I follow the "short"
version of the instructions in the documentation? Is this the way to go to
do what I want, or is it overkill? An alternative I thought of was to
write a small script that simply loads the modules and checks their
VERSION numbers.
Thanks a lot,
David
_________________________________________________________________________
David Coppit - Graduate Student coppit@cs.virginia.edu
The University of Virginia http://www.cs.virginia.edu/~dwc3q
"For I am a Bear of Very Little Brain,
and long words Bother me" - Winnie the Pooh
------------------------------
Date: Wed, 06 Jan 1999 11:54:10 -0800
From: placeit@easyad.com (Marc Austin)
Subject: Re: OK I give up (After a WEEK!) - FIXED!
Message-Id: <placeit-0601991154100001@blv-lx100-ip1.nwnexus.net>
Thanks everybody for your help...
It's working!
------------------------------
Date: Wed, 06 Jan 1999 16:31:32 -0500
From: Mike Bryan <mab@hrb.com>
Subject: Perl and LDAP
Message-Id: <3693D634.7FFF3FDD@hrb.com>
Hello,
Excuse my ignorance since I know very little about Perl.
That said, my question concerns Perl and LDAP. Basically, we a Netscape
LDAP server that we need to authenticate username and passwords against
before a user is allowed onto a select group of web pages (a very simple
user validiation).
Is this possible in Perl (i.e. Do I need to learn Perl)?
Does anybody have any suggestions to where I might look to find scripts
that may already do something similiar? (I have already looked at a lot
of LDAP sites such as Netscape and U. of Mich).
Thank you,
Mike
------------------------------
Date: Wed, 06 Jan 1999 18:46:26 GMT
From: topmind@technologist.com
Subject: Perl Criticism
Message-Id: <770b22$uq6$1@nnrp1.dejanews.com>
Subject: Perl Criticism
Perl gets a lot of credit for its powerful features. However, there are also
some major annoyances about it that prevent more widespread and formal
acceptance. Some say that "fixing" these would dilute its power, but I do not
fully agree with this. I have put together an evaluation of different language
features that I think could be used to build a "safer Perl":
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
A summary of Perl's bigger problem areas are:
- Unnecessary deviations from the "function rule".
- Parameter and variable scope handling
- "Leaky" assignment statements
- Inter- and intra- statement communication problems (including excessive use
of "command piping")
I invite you to look at my criticisms and comment on them, or even pound them
into the ground if you are having a bad hair day :-)
-tmind-
[P.S. screw those arrogant, lazy mind-police known as 'moderators']
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 19:41:36 GMT
From: dturley@pobox.com
Subject: Re: Perl Criticism
Message-Id: <770e9f$21f$1@nnrp1.dejanews.com>
In article <770b22$uq6$1@nnrp1.dejanews.com>,
topmind@technologist.com wrote:
> Subject: Perl Criticism
>
> [P.S. screw those arrogant, lazy mind-police known as 'moderators']
Of course, everyone is entitled to an opinion. But one has to wonder why you
are so unsure of yours that you go immediately into the defensive with
disparaging remarks.
(Esp. since this isn't even amoderated group.)
____________________________________
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 06 Jan 1999 12:12:02 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <3693C392.1AFF4631@atrieva.com>
I'm not going to spend a lot of time telling you you don't know what you
are talking about, as I am sure there will be legions willing to do so.
I'll start at the top.
Says You:
Much of Perl, for example, resembles UNIX scripting languages because
that is what the author was familiar with. UNIX systems have utilities
that allow extensive commands to be issued on the command line. Since
there is only one command line, UNIX programmers have a tradition of
trying to fit as much on one line as possible.
Says Me:
I have four different shells open on my desktop right now, along with
several X-processes and other GUI like things. Which one represents the
"one" command line? What this paragraph tells me is that you have
little or no experience with *nix like systems. I'll bet beer your
experience is almost exclusively WinTel.
Says You:
This tends to make UNIX-derived languages, such as Perl, a bit cryptic.
(Don't get me wrong, Perl is quite powerful, but it needs to get away
from its command-line roots.)
Says Me:
And how, pray tell, do you get away from a command line? I believe
MacPerl has a "drag and drop" functionality.
Your attempts at differentiating "scripting" languages, as opposed to
"real" languages is false. There is no such dichotomy.
topmind@technologist.com wrote:
> - Unnecessary deviations from the "function rule".
What particular operators would you have rewritten into functions?
> - Parameter and variable scope handling
What part of the strict pragma does not satisfy your needs? my() and
local() are well documented.
> - "Leaky" assignment statements
I consider any language that does not return a value from an assignment
broken. If it's the rvalue, that's a Good Thing.
> - Inter- and intra- statement communication problems (including excessive use
> of "command piping")
Here you are absolutely and completely wrong, especially in light of
your misunderstanding of the way in which perl scopes variables.
Given your example:
somefunc(x);
another_op();
belies the fact that you have no idea how subroutines operate in perl.
How perl handles parameters is well defined and documented.
In short, perl has almost none of the problems you imply. I'll bet
another beer that your biggest misunderstanding stems from having not
RTFM enough.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Wed, 6 Jan 1999 13:43:05 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Short way to do this with a regexp?? Delete certain chars from string.
Message-Id: <9ce077.b84.ln@magna.metronet.com>
Charles Wilt (charles.0272@worldnet.no.spam.att.net) wrote:
: I need to replace the following characters with a space if the appear in
: a string:
: \ / : * ? " < > |
$a_string =~ tr#\\/:*?"<>|# #;
: The string will be used as a filename.
Putting spaces into a filename may make it troublesome to use
the filenames. Consider using a hyphen or underscore instead.
I think you may be missing some characters from your list.
Consider replacing _all_ punctuation (except underscore) chars and
space chars with an underscore:
$a_string =~ s/\W/_/g;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Jan 1999 21:30:33 GMT
From: charles.0272@worldnet.no.spam.att.net (Charles Wilt)
Subject: Re: Short way to do this with a regexp?? Delete certain chars from string.
Message-Id: <MPG.10fda3c626f5109e9896b4@netnews.worldnet.att.net>
In article <MPG.10fd41b1e398d07198997c@nntp.hpl.hp.com>, lr@hpl.hp.com
says...
> [Posted to comp.lang.perl.misc and copy mailed.]
>
> Someone else showed you how to do it with a regex, as requested in your
> Subject (using a character class). But by far the faster way to deal
> with single characters without context is to use the 'tr' operator (look
> in perlop instead of perlre):
>
> tr#\\/:*?"<>|# #;
>
> where # is an arbitrary delimiter, just as for a regex.
>
>
Thanks,
someone e-mailed me with the tr solution. I had looked at this op but
didn't realize I could specify a set like that.
--
Charles Wilt
Miami Luken, Inc.
e-mail: charles.0272@worldnet.no.spam.att.net
--->remove the no.spam.
------------------------------
Date: 6 Jan 1999 21:35:44 GMT
From: charles.0272@worldnet.no.spam.att.net (Charles Wilt)
Subject: Re: Short way to do this with a regexp??....Thanks to All
Message-Id: <MPG.10fda4fc2df2f58b9896b5@netnews.worldnet.att.net>
Thanks to all who replied,
I'm using the tr solution. But will look at the others mentetioned to
learn more.
--
Charles Wilt
Miami Luken, Inc.
e-mail: charles.0272@worldnet.no.spam.att.net
--->remove the no.spam.
------------------------------
Date: Wed, 06 Jan 1999 20:42:23 GMT
From: lordkai2@hotmail.com
Subject: What happened to mox.perl.com
Message-Id: <770hrf$5f1$1@nnrp1.dejanews.com>
Been trying to access http://mox.perl.com but keep getting site not
found.....
I noticed the website's author Tom Christiansen had posted here
several times and so I thought I'd leave the question her for him.....
I've
been to site numerous times in the past and would be greatly disappointed if
it went away..... ::(
-- Chris J. Whitcomb
"you know..... Smoke Test.....
turn it on and if it doesn't smoke then its fixed!"
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 4566
**************************************