[13097] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 507 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 13 16:07:18 1999

Date: Fri, 13 Aug 1999 13:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 13 Aug 1999     Volume: 9 Number: 507

Today's topics:
        "set -x" equivalent in perl? (Mark Frost)
        can i read a file backwards? <jcetek@ezzi.net>
        Data collection (serial ports x2) with catagorisation a <stephen@kenworthyschofield.freeserve.net>
        database conversion <sunny@ualberta.ca>
    Re: HARASSMENT -- Monthly Autoemail (I R A Darth Aggie)
    Re: HARASSMENT -- Monthly Autoemail <NOSPAMcollectonian@mindspring.com>
    Re: Nastiness contrary to the spirit of perl? (I R A Darth Aggie)
    Re: passing perl parameters to CGI script (I R A Darth Aggie)
    Re: saving a hash (I R A Darth Aggie)
    Re: Sending mail to "QuestionExchange" (I R A Darth Aggie)
    Re: Sending mail to "QuestionExchange" (I R A Darth Aggie)
        strange syntax error on dangling curly brace "}" jsilve1@my-deja.com
    Re: Tom Christiansen "Perl Cookbook" ("Bill Jones")
    Re: Why use Perl when we've got Python?! (Andrew M. Kuchling)
    Re: Why use Perl when we've got Python?! <arcege@shore.net>
    Re: Why use Perl when we've got Python?! (I R A Darth Aggie)
    Re: Why use Perl when we've got Python?! <uri@sysarch.com>
    Re: Why use Perl when we've got Python?! <arcege@shore.net>
    Re: Why use Perl when we've got Python?! <tchrist@mox.perl.com>
    Re: Win32::Process <kangas@anlon.com>
        Win32::SerialPort --> UN*X::SerialPort <wlhst6+@pitt.edu>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 13 Aug 1999 15:51:50 -0400
From: mfrost@westnet.com (Mark Frost)
Subject: "set -x" equivalent in perl?
Message-Id: <7p1t0m$c2n@westnet.com>



I'm trying to debug a perl script that uses an in-house module.  This
module forks off other perl scripts.  Somewhere along the line something
gets hung up under certain very specific conditions.  We've been looking
at this for months, but have yet to really identify the problem.

These modules/scripts are large and long-running.  While I might be willing
to sit there and single-steup using the debugger through a lot of a script,
the particular script that causes the program is several levels "down"
in the execution order.  For example,

                       a.pl
                        |
                   ----------------
                 a1.pl           a2.pl
                   |               |
             --------------      ------------------------
             |     |      |      |       |      |       |
           a3.pl a4.pl a5.pl    a6.pl   a7.pl  a8.pl   a9.pl


In this example, it would be a2.pl that causes the problem.  One would
think that I could just run a2.pl by itself to reproduce the problem.
Unfortunately, it only runs in the full-blown case (i.e. where a.pl is
run which spawns a1.pl and a2.pl which then later spawn more children and
so on).

This has proven to be really hard to debug.  I can keep dumping "print"s
and log-writing lines in my module, but I can't seem to find the exact
spot where the hang (or loop or whatever's happening is going on).

What I would *love* to have is something that equivalent to the shell's
"set -x" or "sh -x script.sh" where each line that is executed is
printed out.  I tried using "-Dt" with a debugging perl, but that was
a bit too verbose and perl-internal specific to be too helpful.  Or
even, I suppose, running perl with "-d" and then having it automatically
single-step (i.e. without my being there).

Is this just a perl wish list thing or might there be some way for me to
do this?

Thanks

-mark frost


------------------------------

Date: Fri, 13 Aug 1999 15:44:00 -0400
From: "JCEtek" <jcetek@ezzi.net>
Subject: can i read a file backwards?
Message-Id: <Sx_s3.3775$Rh.158796@typ11.nn.bcandid.com>

hi
can i start reading at eof, and read up?




------------------------------

Date: Fri, 13 Aug 1999 20:43:31 +0100
From: "Stephen Kenworthy" <stephen@kenworthyschofield.freeserve.net>
Subject: Data collection (serial ports x2) with catagorisation and storage PROJECT
Message-Id: <7p1sdn$u36$1@news5.svr.pol.co.uk>

I am intending to write an application to collect ascii data from two serial
ports on a IBM PC. Catagorise the information from keywords and stor in a
fromatted file (DB).
The stored files need to be archived every hour.
VT100 emulation is needed to each serial line while collecting data.(half
dp)
1200,n,8,1 for both lines
Later ... offline analysis and presentation of data from stored files with
export to SQL database on network.


Any advice would be of help.

oh I would like to run the script on either DOS or LINUX PC !!!!!


Stephen .Kenworthy
stephen.kenworthy@kenworthyschofield.freeserve.com.uk




------------------------------

Date: Fri, 13 Aug 1999 13:04:21 -0600
From: "Sunny" <sunny@ualberta.ca>
Subject: database conversion
Message-Id: <7p1q4o$kcg$1@pulp.ucs.ualberta.ca>

This is a multi-part message in MIME format.

------=_NextPart_000_005C_01BEE58C.5C382C80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I require some assistance from someone very familiar with Perl. I have a
file consisting of patient records. Some of the fields are LASTNAME
FIRSTNAME MIDDLENAME SEX.. I want to output these fields, along with =
their
values, tab delimited. However, if a particular field is not present, =
i.e.
MIDDLENAME, an extra tab should be left in its place:

Patient 1: LASTNAME=3DDoe    FIRSTNAME=3DJohn    MIDDLENAME=3DFrank    =
SEX=3DM
Patient 2: LASTNAME=3DDave  FIRSTNAME=3DMike                             =
                  SEX=3DM

Please advise on coding for this.

Somebody said to try:

$array =3D ($array) ? $array : "\t";
=20
but it did not work.
=20
Sunny

------=_NextPart_000_005C_01BEE58C.5C382C80
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV>I require some assistance from someone very familiar with Perl. I =
have=20
a<BR>file consisting of patient records. Some of the fields are=20
LASTNAME<BR>FIRSTNAME MIDDLENAME SEX.. I want to output these fields, =
along with=20
their<BR>values, tab delimited. However, if a particular field is not =
present,=20
i.e.<BR>MIDDLENAME, an extra tab should be left in its =
place:<BR><BR>Patient 1:=20
LASTNAME=3DDoe&nbsp;&nbsp;&nbsp; FIRSTNAME=3DJohn&nbsp;&nbsp;&nbsp;=20
MIDDLENAME=3DFrank&nbsp;&nbsp;&nbsp; SEX=3DM<BR><FONT size=3D3>Patient =
2:=20
LASTNAME=3DDave&nbsp; FIRSTNAME=3DMike<FONT=20
color=3D#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
</FONT>SEX=3DM<BR><BR>Please advise on coding for this.<BR><BR>Somebody =
said to=20
try:</FONT></DIV>
<DIV><FONT size=3D3><BR>$array =3D ($array) ? $array : =
&quot;\t&quot;;</FONT></DIV>
<DIV><FONT size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000><FONT size=3D3>but it did not =
work.</FONT></FONT><FONT=20
size=3D3></FONT></DIV>
<DIV><FONT color=3D#000000><FONT size=3D3></FONT></FONT><FONT=20
size=3D3></FONT>&nbsp;</DIV>
<DIV><FONT size=3D3>Sunny</FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_005C_01BEE58C.5C382C80--



------------------------------

Date: 13 Aug 1999 18:58:22 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <slrn7r8qqg.2ri.fl_aggie@thepentagon.com>

On Fri, 13 Aug 1999 20:54:24 -0700, William Pettrey <Bill@fuckyou.co.uk>, in
<37B4E870.7305@fuckyou.co.uk> wrote:

+ Ya, I think everyone has received one of these messages from the local
+ asshole Tom Christenson. Just block his address, I did.

You shouldn't use perl, or are you filtering out the sections of the docs
that TC wrote?

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: Fri, 13 Aug 1999 15:35:21 -0400
From: "Summer S. Wilson" <NOSPAMcollectonian@mindspring.com>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7p1rvo$g6k$1@nntp6.atl.mindspring.net>

Tell your ISP and complain to his.  Then block the emails.

--

Summer S. Wilson
Eclectic Designs,  Webmaster/Website Design
http://www.eclectic-designs.com
http://www.eclectic-mall.com/
http://www.mindspring.com/~collectonian/
ICQ #26835530       AIM:  Lectonian   Elsewhere:  Collectonian
Uriel Wittenberg wrote in message <37B43687.B0525875@tiac.net>...
:This comp.infosystems.www.authoring.html participant appears to have
:opted to openly harass me -- by a monthly autoemail of his message --
:in order to make me conform to his idea of correct style in posting.
:
:Regardless of anyone's position on posting style, I would hope just
:about everyone understands the vindictive and antisocial nature of
:such behavior.
:

***SNIPPED***





------------------------------

Date: 13 Aug 1999 19:08:34 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7r8rdk.2ri.fl_aggie@thepentagon.com>

On Fri, 13 Aug 1999 17:40:56 GMT, Id Est <id-est@home.com>, in
<slrn7r8m2u.4n0.id-est@erato.bigredrockeater.com> wrote:

[to TC, why does lame software insist upon not providing some inkling of
 whom you're talking to?]

+ >When you see kindergarteners littering, you tell them that this is not
+ >a litter zone.  You don't just ignore them, or else pretty soon you've
+ >got a mess on your hands that you'll probably never get cleaned up.

+ what do you do when you see older kids picking on kindergardeners?

So, when I tell you to Read the Fine Manual, or Perlfaq4, I'm picking
on you? Interesting...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: 13 Aug 1999 19:14:43 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: passing perl parameters to CGI script
Message-Id: <slrn7r8rp4.2ri.fl_aggie@thepentagon.com>

On Fri, 13 Aug 1999 18:33:33 +0100, Paul Foran <Paul.Foran@analog.com>, in
<37B456ED.DD9ACCC5@analog.com> wrote:
+ Do I pass parameters to perl script in the
+ #!/usr/local/bin/perl
+ line of a perl script.
+ IWhat parameter do I pass to get perl ro read in a text file. Also How
+ do I handle it to split apart a comma delimited file.

You need to learn some subset of perl before you can do this. You
should go and read the docs, specifically with regard to "open",
"split" and probably the CGI specification and/or 'perldoc CGI'. I
thought there was an entry in the FAQ about parsing comma-seperated
values, but I can't seem to find it.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: 13 Aug 1999 19:22:58 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: saving a hash
Message-Id: <slrn7r8s8k.2ri.fl_aggie@thepentagon.com>

On Fri, 13 Aug 1999 12:24:18 -0400, Marshall Dudley <mdudley@execonn.com>, in
<37B446B2.136F5A10@execonn.com> wrote:

+ Does anyone know how I can read and write a hash from the hard drive so
+ I don't encounter the overhead of having to recreate the hash on each
+ invocation?

What you want is a database file. Check out tie(), and 'man perltie'.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: 13 Aug 1999 19:25:53 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Sending mail to "QuestionExchange"
Message-Id: <slrn7r8se2.2ri.fl_aggie@thepentagon.com>

On 13 Aug 1999 17:19:42 -0000, Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>, in
<7p1k3e$st0$1@lublin.zrz.tu-berlin.de> wrote:

+ I R A Darth Aggie <fl_aggie@thepentagon.com> wrote in comp.lang.perl.misc:
+ >Ah, but how do they know that you've given them a *correct* answer?

+ What do they care?  They expect someone who considers himself an
+ expert has given it a serious try.  That's enough for a bit of
+ advertisement.

The more cynical might suggest salting their postings with wrong answers.

James - not cynical, no, not at all...

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: 13 Aug 1999 19:24:07 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Sending mail to "QuestionExchange"
Message-Id: <slrn7r8sao.2ri.fl_aggie@thepentagon.com>

On 13 Aug 1999 17:02:51 -0000, Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de>, in
<7p1j3r$sqf$1@lublin.zrz.tu-berlin.de> wrote:

+ Oh dear.  Is there any useful dialog going on on n.a.n-a.usenet?
+ A quick look shows only hysterical flamewars, but that are of course
+ the big threads.

In between the trolls and Wollman? yes. Noise >> Signal

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: Fri, 13 Aug 1999 19:14:30 GMT
From: jsilve1@my-deja.com
Subject: strange syntax error on dangling curly brace "}"
Message-Id: <7p1qqd$b8p$1@nnrp1.deja.com>

This might be a repost -- I tried once but was not certain it went
through...

I have this script, it may or may not matter what it does, I don't
know, but I'll sum up as follows:
script basically just prints stuff out to the screen. there are a
couple of subroutines to print out header and footer info.
when testing the script, i get a syntax error "missing right bracket
at script_name line..." basically saying that i need a closing "}"
at the end. no biggee, right? just put a close brace on (which i did)
and it should work fine, right? Well it did.

See, the thing is that there is no matching open curly brace for this
close curly brace!!
  I use the Vi editor. Vi has a key command (%) which shows matching
braces, parens, or brackets by jumping back and forth between them.
 but on this brace it just beeps, indicating a stray curly brace!
WTF?
any comments, ideas, or suggestions?

thank you.
-Jeff Silverman
jeff@jhmi.edu


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Fri, 13 Aug 1999 14:40:29 -0400
From: bill@fccj.org ("Bill Jones")
Subject: Re: Tom Christiansen "Perl Cookbook"
Message-Id: <199908131835.OAA15191@astro.fccj.cc.fl.us>

On Date: 13 Aug 1999 17:51:46 GMT
stanley@skyking.OCE.ORST.EDU (John Stanley) wrote -

> ... someone else's mail server? Or am I using a another machine's mail
> server? Do you grok the difference?

Yes.

>
> And now please explain what you think is wrong in using someone else's
> mail server. You better not be too convincing.
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

John wins; I'll go back into hibernation now...

-Sneex-  :]


As a small token of an apology to the group for my part in this;
here is something I've been working on (the short version):

# Convert word list to definable...
# by -Sneex- 08/6/99 @ 10:00AM

open IRECORD, "<source.html" or die "Ouch $!";
open ORECORD, ">target.html" or die "Yowie $!";

my @words = qw(hardware software wetware);

sub replacement {
  my $var = shift;

  qq{<A HREF=\"/cgi/http_webster?isindex=$var\"
      onMouseOver=\"window.status='Define this word.'; over('');\"
      onMouseOut=\"window.status='Pick a word...'; out('');\">$var</A>};
}

$/ = '';

while (<IRECORD>) {

  foreach (@words) { # Replace only the first occurrence..
    s{(\b$_\b)} {&replacement($1)}ime;
  }

# Write out record...
    print ORECORD;
}



------------------------------

Date: 13 Aug 1999 15:34:43 -0400
From: akuchlin@mems-exchange.org (Andrew M. Kuchling)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <3d672jwk30.fsf@amarok.cnri.reston.va.us>

"John W. Stevens" <jstevens@basho.fc.hp.com> writes:
> Ok.  I'll take that challenge. . . create for me an unreadable
> Python program that actually compiles and runs.

Try:
 http://www.python.org/doc/FAQ.html#4.15 
 http://starship.python.net/crew/amk/writing/crypto-curiosa.html  

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
What are we doing in this suburban living room? And look at that furniture,
for God's sake!
    -- The narrator comments on decor, in ENIGMA #5: "Lizards and Ghosts"



------------------------------

Date: Fri, 13 Aug 1999 19:45:02 GMT
From: "Michael P. Reilly" <arcege@shore.net>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <2B_s3.18$mV.5690@news.shore.net>

John W. Stevens <jstevens@basho.fc.hp.com> wrote:
: Kvan wrote:
:> 
:> Ian Clarke <I.Clarke@strs.co.uk> writes:
:> 
:> > Perl seems to be more of a rebellion against good language design, and
:> > while people claim that this makes it "more efficient" to code in, I
:> > have yet to see the proof - particularly if you include the time it
:> > takes to debug the code.
:> 
:> The proof with a thing such as coding, and particularly debugging, can
:> only be seen by doing it. Perl offers lots of debugging options, and
:> is in fact one of the easiest languages I've debugged in yet.

: Perls built in debugger is a plus.  I wish Python had a -d switch.

Python's debugger is a module called "pdb".  If you want to debug a
program (called as a program), then you would type:
  $ python
  >>> import pdb
  >>> pdb.run('execfile("program.py")')
  > <string>(0)?()
  (Pdb) step
  > <string>(1)?()
  (Pdb) step  # or just hit return
  > program.py(0)?()
  (Pdb) quit
  >>> # debug just a function
  >>> pdb.run('myfunction(1, 2)')

As a very handy feature, pdb allows post-mortem debugging, much like
entering gdb with a core file.

But personally (and professionally), I am of the philosophy that a
person who requires a debugger to program shouldn't be in this
business.  If you can't envision what is going on in your mind, then
you won't get a real picture when you run through a debugger, and
especially won't when the program goes into use and the debugger isn't
there.  <Arcege gets down off his little soapbox now for a moment.>

: On the other hand, in small studies, Python programmers create fewer
: bugs in the first place, find the ones they do create faster, and
: fix them with less chance of introducing new bugs.

Oh... this isn't all that true.  Experienced Python programmers create
as many bugs as experienced Perl or C programmers.  It's the classes of
bugs that may be different, that that's normal with different
languages.

Python programmers may appear to create fewer bugs when in reality they
often create fewer design flaws; the Python programmer will still make
the same amount of bugs.  One of the advantages of Python written using
it's basic syntax is that the syntax looks very much like most
algorithms would be written.  Perl's syntax sugar is there to reduce
the coding times, but sometimes at the expense of clarity of the
algorithm.  This isn't always the case, a person could write unclear
Python code and very clear Perl code.  But when taken in the context of
the general structures and common idioms of each language, this is
most often the case.

:> Yet, many C programmers actually use a Hungarian notation anyway. In
:> perl it is enforced, and allows you to quickly judge the type of
:> complex constructs (it's easy to tell that @{$foo->bar("snafu")} is an
:> array, even without knowing a thing about the scalar $foo). This is,
:> I'll admit, quite contrary to the TIMTOWTDI philosophy of Perl, but it
:> works well.

And many of those C (and Perl and Python and...) programmers actually
NEED the Hungarian notation because they weren't taught how to program
in the first place.  But this is off-topic in some ways, folks.

:> The bottom line is that, while it may look less clean to the untrained
:> eye, Perl code is actually very readable once you know how to read
:> it.

: This is a generically true statement: "Once you've learned how to do
: it, you know how to do it."

: Perl is harder to learn how to read, harder to remember how to read,
: and harder to read if you, yourself, did not write it.

And putting on my release manager cap, Perl is harder to maintain and
manage in general than Python code.  This is not always the case, just
a week or so ago, I was asked to integrate DBI::Oracle into wdb (using
isqlperl; remember that? a Perl4 interpreter).  Except for finessing
the initialization to switch between the isqlperl and Perl5
interpreters when appropriate, the code changes were fairly clear.  The
other Perl code I was asked to change (which was the majority of the
code) wasn't as well organized and thought out, and more difficult to
update.

:> This also means that you cannot fairly assess the repective merits
:> of Python and Perl without knowing both fairly well--and since I don't
:> know much Python (always meant to learn it, but didn't find the time
:> so far), I won't get any further into this.

: For short, small, throw away programs, especially if you do
: pure-procedural
: programming, Perl is rather nice.  And before PCRE, I prefered Perl to
: Python for text processing.

Can't beat Perl's regexp engine, but I rarely need to use regular
expressions anymore. Most of the parsing I do (some of which aren't
trivial), can be done through Python's string module.

: With PCRE, I prefer Python.  I am slowly giving up Perl altogether,
: except as a training language in OO classes.  Not to surprisingly,
: Python is preferred more than 7 to 1 over Perl by students who are
: exposed to both at the same time.

As some of the pro-Perl people here have admitted, learning Perl _can_
be a task, and Python has a clearer syntax.  But this is not an
argument for which is a better language.  (Not to mention that this "7
to 1" reminds me of that old 9 out of 10 grade school kids prefer Crest
commercial, or whatever it was.)  We aren't trying to promote the
languages, but give clear arguments of when and why one language would
be better over the other.

  -Arcege



------------------------------

Date: 13 Aug 1999 19:36:45 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r8t2e.2ri.fl_aggie@thepentagon.com>

On Fri, 13 Aug 1999 16:50:20 GMT, Skip Montanaro <skip@mojam.com>, in
<7p1ic8$51h$1@nnrp1.deja.com> wrote:

+ Along the lines of DWIM, the following seems to me to be a DWIMish
+ shortcoming in Perl:

+     echo 'print "19" + "14.5";' | perl

Really? since when is "+" concatenation of strings in perl? This is
more accurate:

echo 'print "19" . "14.5","\n";'|perl

1914.5

"+" is a numeric operator in perl, and perl automagically de-stringifies
stringified numbers. Perl is context dependent, and in this case, gets
the context from the operator.

You're trying to mix camels and snakes...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>


------------------------------

Date: 13 Aug 1999 15:55:18 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <x7672j5uc9.fsf@home.sysarch.com>

>>>>> "JWS" == John W Stevens <jstevens@basho.fc.hp.com> writes:

  JWS> It comes down to the issue we discussed once before: Python is
  JWS> the better language for OO, and I write OO most of the time.  I
  JWS> know you disagree.  But my students, in general, also believe
  JWS> that Python is a better OO scripting language than Perl.

check out the new book, OO Perl by damian conway. it is on the presses
now and should be on sale at the monterey conference (which has a python
track). it will answer all your OO perl issues and more. if done right
and by using modules to help OO is veyr powerful and useful in perl. i
don't prefer OO unless it is warranted. that is one of the reason i
don't like java/python types of languages. i want to be able to choose
OO or not myself and not have the language force it upon me. OO is not a
cure all for programming ills. it is just another methodology in the long
line that stretches back to structured programming and early high level
languages that were supposed to save the world from bugs. OO won't do
that either. it still falls on the shoulders of those who know how to
design code vs those who can't. you can design lousy OO and most of it
is like most code in general is. it isn't any more shareable and a well
written library with a good api.

so having the language enforce OO is no win. as for newbies finding
python more readable (as opposed to experienced c programmers) that is
meaningless. i find tcl hard to read too. a well as lisp (which i know)
and other languages which i don't know. tom's point about not knowing
how to read a foreign language is very true. how does that line go? 
boy i am glad i was born in the US, because i know english already.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: Fri, 13 Aug 1999 19:55:36 GMT
From: "Michael P. Reilly" <arcege@shore.net>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <YK_s3.19$mV.5690@news.shore.net>

John W. Stevens <jstevens@basho.fc.hp.com> wrote:
: I R A Darth Aggie wrote:
:> 
:> On Thu, 12 Aug 1999 09:31:05 +0100, Ian Clarke <I.Clarke@strs.co.uk>, in
:> <37B28649.9C7F0C1E@NOSPAM.strs.co.uk> wrote:
:> 
:> + I am glad you could care less, but if someone would only provide me with
:> + some solid reasons for why I might want to use Perl over Python (other
:> + than wishy washy "Perl is more efficient to code in" or "I tried Python
:> + and didn't like it" comments) then I might consider trying Perl.
:> 
:> Why do you need reasons to try perl? why don't you just *use* it and come
:> to your own conclusion. Or how are you going to, in your words:
:> 
:>   How can you choose the best tool for a job, if you know nothing about
:>   other tools?
:> 
:> James - as a fortran programmer, I can make any language unreadable...


: Ok.  I'll take that challenge. . . create for me an unreadable
: Python program that actually compiles and runs.

John, pls don't throw out challenges you aren't willing to own up to. ;)

  -Arcege



------------------------------

Date: 13 Aug 1999 14:04:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <37b47a37@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "John W. Stevens" <jstevens@basho.fc.hp.com> writes:
:Perl is harder to learn how to read, harder to remember how to read,
:and harder to read if you, yourself, did not write it.

Proof my assertion, eh?  I disbelieve.  I want to see quantifiable,
reproducible, and consequently irrefutable proof that Perl code that I
did not write is harder for me to read than Python code I did not write.

Good luck.

--tom
-- 
    "Do we define evil as the absence of goodness?  It seems only logical
    that shit happens--we discover this by the process of elimination."
    	--Larry Wall


------------------------------

Date: Fri, 13 Aug 1999 14:19:37 -0500
From: Mike <kangas@anlon.com>
Subject: Re: Win32::Process
Message-Id: <37B46FC8.38C0D1B2@anlon.com>

I tried it but on NT it doesn't know what to do and errors out. I have
tried some piping but could not get it to work properly.

I am trying to run five processes at a time and when one finishes the
sixth will take its place. I want the five to run in parallel. The
proplems I am having with piping is that the child processes are run one
at a time and this is not what I want. Maybe I am not doing it properly
with piping.... I don't know. But I can get Win32::Process to do just
this but I don't want to use flat files for the child to pass data to
the parent.

Thanks.

Anno Siegel wrote:

> Mike  <kangas@anlon.com> wrote in comp.lang.perl.misc:
> >how do i get a parent process to grab variable values from a child
> >process or have the child give the variable values to the parent.
>
> Read the perl manual about open and take a close look at the "-|"
> filehandle.
>
> Anno

--
Michael Kangas
Anlon Systems, Inc.
kangas@anlon.com




------------------------------

Date: Fri, 13 Aug 1999 15:58:19 -0400
From: "W. Lyle Hayhurst" <wlhst6+@pitt.edu>
Subject: Win32::SerialPort --> UN*X::SerialPort
Message-Id: <Pine.GSO.3.96L.990813155604.8930A-100000@unixs1.cis.pitt.edu>


Are there plans to port this module to any of 
the UN*X flavors?
Thanks,
Lyle



------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 507
*************************************


home help back first fref pref prev next nref lref last post