[6731] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 356 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 23 16:07:49 1997

Date: Wed, 23 Apr 97 13:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Apr 1997     Volume: 8 Number: 356

Today's topics:
     A stupid thing! <biczok@iaehv.nl>
     Re: A stupid thing! (Jason Lane)
     Re: HTML Parser anywhere ? <aas@bergen.sn.no>
     Re: I/O on serial device? (Abigail)
     Re: Interpolating subroutine names? <tchrist@mox.perl.com>
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <erik@naggum.no>
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <prasadm@polaroid.com>
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th schaffer@wat.hookup.net
     Re: Matching (and m//o and eval) <psrc@corp.airmedia.com>
     Re: No syntax errors, but still the thing won't run <rant@lp-llc.com>
     Re: No syntax errors, but still the thing won't run <michaeli@dra.com>
     Re: No syntax errors, but still the thing won't run <tchrist@mox.perl.com>
     Re: Ousterhout and Tcl lost the plot with latest paper (Kelly Murray)
     Perl 5 For Dummies <valentin@cybernet.dk>
     Re: Perl as its own metalanguage? <eryq@enteract.com>
     Re: PERL file upload ?!?!? (Fapso Marek)
     Re: STDOUT | PAGER <psrc@corp.airmedia.com>
     Re: switch and if (David Alan Black)
     Re: switch and if <minaret@sprynet.com>
     Re: sysopen object method in perl 5.001? <ed@texas.net_nospam>
     Troubles with IIS and ODBC (Gordon Andrew Ross)
     Re: Who will win?  Borland or Microsoft or Programmers? <dhiggins@netbiz.net>
     Re: Who will win?  Borland or Microsoft or Programmers? chas@aol.com
     Re: Who will win?  Borland or Microsoft or Programmers? chas@aol.com
     Re: why cant I access/print a list-of-lists this way <dbenhur@egames.com>
     Re: Why perl/TK hardly mentioned in Camel Book? (Ilya Zakharevich)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 23 Apr 1997 19:47:06 +0200
From: Biczok Norbert <biczok@iaehv.nl>
Subject: A stupid thing!
Message-Id: <335E4B1A.6A8F@iaehv.nl>

Dear anybody,

do you have any suggestions why this command does not work:

s/<.*?>//g;

and gives the following error message:

/<.*?>/: nested *?+ in regexp at .....


Thank you very much in advance,

Norbert


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

Date: 23 Apr 1997 14:21:05 -0400
From: jlane@pathfinder.com (Jason Lane)
Subject: Re: A stupid thing!
Message-Id: <5jljuh$18g@bilbo.dev.pathfinder.com>

In article <335E4B1A.6A8F@iaehv.nl>, Biczok Norbert  <biczok@iaehv.nl> wrote:
>
>do you have any suggestions why this command does not work:
>
>s/<.*?>//g;
>
>and gives the following error message:
>
>/<.*?>/: nested *?+ in regexp at .....
>
>Norbert

You're not using Perl 5.

-- 
--
Jason J. Lane                              jlane@pathfinder.com
Lead Application Developer                 212-522-9613
Time Inc. New Media                        http://www.pathfinder.com


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

Date: 23 Apr 1997 20:32:58 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: HTML Parser anywhere ?
Message-Id: <h9129mvxh.fsf@bergen.sn.no>

Leon Brocard <lglb@doc.ic.ac.uk> writes:

> Hmm, this is actually a rather good module, but I seem
> to remember that the $p->asText (or whatever) didn't work
> properly for tables - it didn't end table rows or table datas
> with </TR> or </TD>, which kind of confuses any HTML parser.
> 
> Any idea why / how this is? Leon.

Because the HTML3.2 DTD says:

<!ELEMENT table - - (caption?, tr+)>
<!ELEMENT tr - O (th|td)*>
<!ELEMENT (th|td) - O %body.content>

-- 
Gisle Aas <aas@sn.no>


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

Date: Wed, 23 Apr 1997 17:44:04 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: I/O on serial device?
Message-Id: <E93qLG.G4z@nonexistent.com>

On Tue, 22 Apr 1997 18:52:32 -0700, Jamie Zawinski wrote in
comp.lang.perl.misc <URL: news:335D6B60.3976B227@netscape.com>:
++ I want to have a Perl script that talks to my modem.  This doesn't
++ work:
++ 	open(DEV,"</dev/ttyf1");
++ 	print DEV "AT\n";
++ 
++ 	while(<DEV>) {
++ 	    print "<== " . $_;
++ 	}
++ 

Four things:
- You didn't use perl -w.
- You didn't check the return value of open.
- You should have used '+<' in the open.
- You didn't use perl -w.

open DEV, "+< /dev/ttyf1" or die "Something horrible happened: $!";
print DEV "AT\n";
while (<DEV>) {
    print "<== ", $_;
}



Abigail  --  Now about that <table align = 'center'> ...


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

Date: 23 Apr 1997 18:38:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Interpolating subroutine names?
Message-Id: <5jlkuv$m7e$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> writes:
:! what I want to do is something like this:
:!         &do$items[$loc];
:! where $loc is a placeholder that tells where in the array I
:! am.
:! 
:certainly, use eval:
:
:   eval "&do$items[$loc]";

Never use eval just to construct variable names.  It's wasteful, and
traps exceptions you may not with to catch.

This suffices:

    &{ "do$items[$loc]" }();

is a much better approach.  Better yet, store pointers to the function
inside the data structure to begin with.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


I just hate to be pushed around by some fucking machine. - Ken Thompson, on the i960


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

Date: 23 Apr 1997 17:44:02 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <3070806242699875@naggum.no>

* M. Prasad
| We seem to have lots of opinions, with a fair amount of blame placement
| on management.  But you don't get to manage a start-up with that many
| high-powered brains, unless you are really good and proven.  So I still
| doubt the "bad management" theory very much.

I think it would be instructive for you to study the demise of Lucid, Inc.
and the way its founder, Richard P. Gabriel, was treated by the investors
(the _actual_ managers) of the company.

if a company fails, it's because of bad management.  if it succeeds, it's
because of good employees.  that is, companies with good employees and bad
management fail.  companies with bad employees and good management fail.
the latter combination does not occur in practice.

however, more often than not, the whoever holds the purse is the actual
management of a company.  and more often than not, people who make lots of
money are good at screwing people who trusted them, not at making good
technical decisions.  (no, Bill Gates is not an exception to this rule.)
and if you make good technical decisions, you need a small, privately held
company to make it to manager.

a quick look at the Lisp industry will show you what kind of people lead
them, what kind of companies are really in this market, and also the
commonality of the failures.  this is another reason I want to work with
Lisp.  I don't want to deal with software companies that let people like
John Ousterhout do their marketing.  (does that wrap this up?  nah.)

#\Erik
-- 
if we work really hard, will obsolescence be farther ahead or closer?


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

Date: Wed, 23 Apr 1997 14:00:15 -0400
From: "M. Prasad" <prasadm@polaroid.com>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <335E4E2F.776E@polaroid.com>

Erik Naggum wrote:
> 
> * M. Prasad
> | We seem to have lots of opinions, with a fair amount of blame placement
> | on management.  But you don't get to manage a start-up with that many
> | high-powered brains, unless you are really good and proven.  So I still
> | doubt the "bad management" theory very much.
> 
> I think it would be instructive for you to study the demise of Lucid, 

Is it just my perception, or does this gent really
have a severe attitude problem?


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

Date: 23 Apr 1997 18:53:13 GMT
From: schaffer@wat.hookup.net
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <5jllqp$ilq$1@nic.wat.hookup.net>

In <5jj43q$sk9@chnews.ch.intel.com>, jvrobert@sedona.intel.com (Jason V. Robertson~) writes:
> ...
>>access.  LispM's weren't the machines crashing when those internet worm
>>attacks were going on!
>
>Neither were PC's running Novell.  Of course LispM's wouldn't be affected - 
>the worm targetted only Unix machines running Sendmail (I think?).

Among other things.  I think it had three or for lines of attack (finger
was one of them), and depended on overwriting part of the stack with
machine code (I think it was sending binaries for 3 or 4 different CPUs
and OSes, Novell probably not among them, but most likely VMS).

Hartmann Schaffer



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

Date: Wed, 23 Apr 1997 13:53:00 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
Subject: Re: Matching (and m//o and eval)
Message-Id: <335E4C7C.AB1@corp.airmedia.com>

Jordyn A. Buchanan wrote:
> While not quite as versatile as what you have above, the following will
> work if you want to do a regex every time:
> 
>       $tmp = '\d\d\t  \d';
>       while(<INFILE>) {
>          if (/$tmp/o) {       # Note the 'o' here to save CPU cycles
>             do something;     # Actually, this does nothing
>          }
>       }

I presume "want to do a regex every time" means "want to match the same
regex throughout the lifetime of your program."

I have the same problem the original poster may have: I get a query,
build up a regex for the query, match potentially a *lot* of input
against the regex ... and then get another query, etc. I've left
comments about what code to put the eval "" around (a *big* honking
bunch of nested loops). I haven't done it yet; it's going to make the
application significantly harder to debug.

Note you need eval "", not eval {}; see MASTERING REGULAR EXPRESSIONS
for an explanation.

If you can generate a string you *know* will be matched by the regex,
you can say:

$string =~ /$tmp/ or die "didn't reset the default regex";
while (<INFILE>) {
	if (//) {  # match previous regex
		do something;
	}
}

But it's virtually impossible to create such a string.

--Paul S. R. Chisholm, AirMedia, Inc.      (formerly Ex Machina)
mailto:psrc@corp.airmedia.com http://www.corp.airmedia.com/~psrc
  I'm not speaking for the company, I'm just speaking my mind


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

Date: Wed, 23 Apr 1997 11:21:22 -0700
From: Kevin Cotter <rant@lp-llc.com>
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <335E5322.57D0@lp-llc.com>


Let me respond this way.  

First I (Kevin Cotter) wrote the message Tom Pheonix responded to.

Now, Excuse me Asshole :-) for trying to learn a new skill.  I don't
just want to use someones elses code without being able to understand
what it's doing.

I appreciate you responding to my query but in the future if all you're
going to do is tell me what a moron I am then don't waste the space on
the newsgroup.  I understand that with your superior intellect it must
be a pain to deal with us idiots - God I know you've never had a problem
with a program and YOU NEVER asked a stupid question about coding.  You
were born with these skills.  I bow to you my Lord, Tom Phoenix.

I apoligize to anyone else in this newsgroup that is offended by my
response. And sorry for taking up room in this newsgroup with my
venting.


Tom Phoenix wrote:
> 
> On 22 Apr 1997, Tammy Cotter wrote:
> 
> >    if ($ENV{'REQUEST_METHOD'} eq 'POST') {
> >       # Get the input
> >       read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> >       @pairs = split(/&/, $buffer);
> >                 foreach $pair (@pairs) {
> >                  ($name, $value) = split(/=/, $pair);
> >                 }
> >            }
> >     else {&error;}
> 
> Number one, you're doing this the wrong way. That's not a good way to
> decode web input.
> 
> And, B, do you see that in your inner loop you're overwriting $name and
> $value for each item? That's going to discard all but the last set.
> 
> Third, you should be using CGI.pm or another module from CPAN, which will
> do all you need and more. (CGI.pm can even let you test your module
> without the server, which is pretty handy.) In your attempt to reinvent
> the wheel, you seem to have gotten a flat tire. :-)
> 
> IV.  Hope this helps!
> 
> -- Tom Phoenix        http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
> Randal Schwartz Case:     http://www.lightlink.com/fors/


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

Date: Wed, 23 Apr 1997 15:09:44 -0400
From: Michael Iles <michaeli@dra.com>
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <335E5E78.201@dra.com>

Kevin Cotter wrote,
> Now, Excuse me Asshole :-) for trying to learn a new skill.  I don't

This is the most curious construct I've seen in a long time. How does
the smiley qualify the 'asshole'? "Well, I just  compared you to my
unwiped bottom and insulted your mother, but hey, why don't you come on
over for Sunday dinner?" Is this a new kind of doublespeak? Do you think
Dilbert gets letters from his boss that start with, "Dear Useless
Employee :)"? If two smileys were included after the 'asshole' would it
bring the whole thing up to the level of quite a nice compliment?

I'm baffled.

Mike.

(To Kevin: RELAX! You got some excellent advice from Tom. You can learn
way more by exposing yourself to the high quality code in CGI.pm or the
LWP family than by trying to code it yourself in isolation.)

-- 
Michael Iles, michaeli@dra.com
Ceci n'est pas une .sig


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

Date: 23 Apr 1997 19:06:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <5jlmjj$nsn$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, raven@lp-llc.com writes: :Now, Excuse me Asshole
:-) for trying to learn a new skill.  I don't :just want to use someones
elses code without being able to understand :what it's doing.

Lay off.  You have just asked the most fricking frequently asked
question in the history of this newsgroup, and it has nothing to do
with Perl.  You are recreating a wheel that's already been done a
zillion times, and you have the same bugs that about a zillion minus
three implementations have used.  Why do you expect the volunteers of
this group to spend laborious hours typing in the same answer to the
same question for every person who uses this broken code?  Don't you
think it much better to point them to a solution that works?  Did you
look at Alta Vista and Deja News for previous treatments of this matter?
Have you read the Perl FAQ?  What about the CGI FAQ?  Did you read the
Idiot's Guide mentioned in Section 9 of the Perl FAQ?  Did you look at
the existing solutions to see what they were doing that you weren't?
How much effort did you put in to help yourself?  Now, given that, you
still expect us to painstakingly debug your broken code such as has been
done hundreds of times in the past?

Why?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
Your csh still thinks true is false.  Write to your vendor today and tell
them that next year Configure ought to "rm /bin/csh" unless they fix their
blasted shell. :-)   --Larry Wall in Configure from the perl distribution


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

Date: 23 Apr 1997 19:01:42 GMT
From: kem@franz.com (Kelly Murray)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5jlmam$r2a$1@sparky.franz.com>

> The "battle" is a battle for mindshare.  That battle is fought one
> mind... one program... at a time.  So we Tcl weenies just keep on
> chooglin'.  If you're a committed bike rider and you turn into a strong
> headwind, you don't get mad, you just downshift, put your head down, and
> pedal.  And before too long, you've ridden pretty far.  You want LISP's
> influence to increase, you're not going to get people to do it your way
> by flaming them.  You've gotta remove obstacles to its use, pump out
> tools and apps, help people who run into problems, and push out the
> examples and games and clever little hacks that pique peoples'
> curiosity.  You gotta sell it to the people who would use it.  And make
> sure it really is as general purpose as you say... Like rewrite some
> shell scripts in it.  But a lot it seems like the attitude of the LISP
> camp toward workaday programmers ranges from condecension to derision to
> outright contempt.  You want LISP to do better? Lose the attitude, and
> make sure you have a good, free implementation that runs real well on
> Windows 95.

I absolutely agree.
This "MIT" attitude has continued to linger.
But if I have my way, those days are OVER.   

The view that Lisp must be an order of magnitude better to win, 
ends up with making it be an order of magnitude more complex, 
and those who don't need nor understand this complexity are viewed as
"not worthy" --- is it any wonder why Lisp won't be widely used?

If one reads my first CLOS column in JOOP, it is titled,
"Invitation to CLOS", where I invite everyone to join the party,
not make it the exclusive club with secret parenthesized handshakes,
which has been its history.

I'll make this concrete:
  
I propose a new dialect which has a simplified syntax, that makes it accessible,
but without losing it's power, by adding a few simple keywords
to replace parenthesis.  It isn't (foo 1 2) vs foo(1,2) that's the barrier
or problem, it is having this:

  (let ((x 10) (y 20))
    (do ((i 0 (+ i 1)))
        ((> i 10) x)
     (cond ((> x y) 10) 
           ((< x 0) 20))))
           
When it is much clearer and accessible if it is written like this:

 (let x = 10
      y = 20
    do
    (loop for i from 1 to 10
      do
      (if (> x y)
        then 
          10
       elseif (< x 0)
        then 
          20
        else
         nil)

And has no less power than the more parenthesized version: 
The functional view is just the same, and macros are no less powerful.
        
-Kelly Murray  (speaking for myself) 

      
      
     






 


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

Date: Wed, 23 Apr 1997 21:06:36 +0200
From: Thomas Valentinsen <valentin@cybernet.dk>
Subject: Perl 5 For Dummies
Message-Id: <335E5DBC.2EB@cybernet.dk>

Hello,

Now it is possible for you to buy the book "Perl 5 For Dummies" live on
the Internet in our bookstore.
The price in OUR bookstore is: $26.99. (The price of the book at
www.dummies.com is $29.99!).
We will ship to almost any country in the world, and we accept online
payments!

If you are interested in buying the book, then load the following page:

http://www.cybernet.dk/users/valentin/books.html

and click on the "Perl 5 For Dummies" link on the page.



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

Date: Wed, 23 Apr 1997 13:01:38 -0500
From: Eryq <eryq@enteract.com>
To: Luca Passani <lpa@sysdeco.no>
Subject: Re: Perl as its own metalanguage?
Message-Id: <335E4E82.2EB6F816@enteract.com>

Luca Passani wrote:
> 
> Well, comparing Prolog to Perl can cause an interesting academical
> discussion, but, in practice, they are two totally different worlds
> not worth comparing.

I agree, but then you go on to say...


> Perl is good for having things done. Perl is legitimated by those who
> use it. Perl does not expect anyone to give it respect it didn't deserve
> on the programming fields. Perl is capitalism.
> 
> Prolog is not good for any serious application. Prolog is legitimated by
> those guys in Universities that never really had to deal with real
> software development. Prolog is made and supported by idealist
> raving about a future that will never come. Prolog is communism.

Having used both languages pretty extensively, both in and out of academia,
I don't think this is a fair assessment at all.

First of all, the claims you make about Perl-over-Prolog have been made
extensively about C-over-Perl (and even VisualBASIC-over-Perl): namely,
that C/VB is for the "real world", and Perl is a "toy for hackers".  
I think many of us in c.l.p.* know where we stand on this.  :-)   

Second: Prolog is an excellent languange for implementing expert-systems, and
there are many expert-systems applications out there which you might
not be aware of.  The most common seem to be "diagnostic assistant" tools... 
I've heard of the operational use of:

	* a medical diagnosis application, intended as a teaching tool I think.

	* a system for assisting physicians in the prescribing of 
	  several drugs to a patient w.r.t. avoiding dangerous interactions 
	  and allergic reactions, and also usable by pharmacists. 

	* a system which assists chemists in the reading of spectroscopic 
	  analyses to determine the composition and structure of an unknown 
	  molecule.

Nowadays, with people embedding language-interpreter code in their C applications, 
you can't just look at a system running on a PC and say "that doesn't use Prolog
or CLIPS or Perl or XXX".  You might be surprised at what's really going on 
behind the scenes. 

There is little wisdom in arguing the virtues of a screwdriver over
a hammer.  The right tool for the right job.  

Regards,
-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.enteract.com/~eryq
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 23 Apr 1997 17:52:36 GMT
From: fapsom@hron.fei.tuke.sk (Fapso Marek)
Subject: Re: PERL file upload ?!?!?
Message-Id: <5jli94$62q$1@ccnews.ke.sanet.sk>

w.vogel (w.vogel@student.kun.nl) wrote:
: Hi there!
: 
: I am tying to allow my visitors to upload pics
: to my site. Now i already know I have to use a
: form with enctype=multipart/form-data and method
: is POST, but the entered filename does not transfer
: anything into my $in{'file'}....

I use CGI.pm 2.30 library for processing. Try to see CGI.pm example file
file_upload.cgi .

use CGI;
$q = new CGI;

 $file=$q->param('file');
 while(<$file>)
 {
 ...

 }
 close($file)

: I am doing something very wrong. But what?
: Who can help me on this?
: 
: Wouter Vogel,
: w.vogel@student.kun.nl

				Marek!

--
fapsom@hron.fei.tuke.sk


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

Date: Wed, 23 Apr 1997 14:02:28 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
To: Chipmunk <Ronald.J.Kimball@dartmouth.edu>
Subject: Re: STDOUT | PAGER
Message-Id: <335E4EB4.3FC@corp.airmedia.com>

Chipmunk wrote:
> Unfortunately, if the pager is more, and I exit more in the middle of
> the output by typing 'q', my perl program exits with the message
> 'Broken Pipe'.

That message is really coming from your shell, telling you why the
program (your perl script) died. To avoid this problem, trap or ignore
the SIGPIPE signal.
--
Paul S. R. Chisholm, AirMedia, Inc.        (formerly Ex Machina)
mailto:psrc@corp.airmedia.com http://www.corp.airmedia.com/~psrc
  I'm not speaking for the company, I'm just speaking my mind


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

Date: 23 Apr 1997 18:10:31 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: switch and if
Message-Id: <5jljan$q29@pirate.shu.edu>

Hello -

iqbal gandham <igandham@prestel.net> writes:

>Hi

>Is it better to use an if statement or switch, or doesn't it make much
>difference. 

Switch to what?  C, perhaps?  :-)

>I have about eight if else statemants.

>As far as I know if you use if statements then it checks through every
>statement, whereis using the switch method you can fall out of the block
>when say the pattern is met. 

if..elsif... constructs will check every *condition* until *one*
is met (unless there's some principle of inefficiency in force which
I'm unaware of).

Perl doesn't have a switch() statement, but there's nothing you
can't do by way of switching, testing, conditionally executing,
falling, breaking....

My Camel is at home (I took the car this morning :-), but I believe
there's some discussion of this in there.


David Black
dblack@icarus.shu.edu 


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

Date: 23 Apr 1997 18:32:43 GMT
From: "Geoff Mottram" <minaret@sprynet.com>
Subject: Re: switch and if
Message-Id: <01bc5014$931ab3e0$eccbaec7@cactus>

> Is it better to use an if statement or switch, or doesn't it make much
> difference. 

There is no switch statement in Perl.

-- 
Geoff Mottram
minaret@sprynet.com


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

Date: 23 Apr 1997 19:30:12 GMT
From: Edward Henigin <ed@texas.net_nospam>
Subject: Re: sysopen object method in perl 5.001?
Message-Id: <5jlo04$k2e$1@news3.texas.net>

Tom, I highly respect your programming skills, but...


Tom Christiansen <tchrist@mox.perl.com> wrote:

: Anyway, didn't anyone every tell you that it's a lousy idea to use
: the existence of a file as a lock?  it doesn't work over nfs,
: and it often fails for the superuser.  and creating it read only
: with a write only mask is subclever.  make sure you put host and pid
: in the file if you cannot be convinced to stop using this lousy way.


	Give us a f*cking working flock() for solaris and we'll stop
using file existance.

	besides, under solaris open.2 manpage:


     O_EXCL        If O_EXCL and O_CREAT  are  set,  open()  will
                   fail  if  the  file exists.  The check for the
                   existence of the file and the creation of  the
                   file  if  it  does  not  exist  is atomic with
                   respect to other  processes  executing  open()
                   naming the same filename in the same directory
                   with O_EXCL and O_CREAT set.

	it works.  it works by design, it's guaranteed to work.
(on solaris anyway, where flock() is unavailable.)


	Thanks for the opportunity to vent,

	Ed


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

Date: 23 Apr 1997 18:16:33 GMT
From: gordonr@sfu.ca (Gordon Andrew Ross)
Subject: Troubles with IIS and ODBC
Message-Id: <5jljm1$ne$1@morgoth.sfu.ca>

Hello,

We've recently reinstalled NT 4.0 on our web server, and have run into some
difficulties.  We're using Perl 5.001, Build 110, along with ODBC.pm.  This
has worked flawlessly in the past, but something happened during the
reinstall.  Here's our error message:

HTTP/1.0 200 OK
Server: Microsoft-IIS/2.0
Date: Tue, 22 Apr 1997 21:38:48 GMT
Content-Type: application/octet-stream
Can't load 'C:\Perl5\lib/auto/Win32/ODBC/ODBC.pll' for module Win32::ODBC:
5 at
C:\Perl5\lib/DynaLoader.pm line 450.

 at C:\Perl5\lib/Win32/ODBC.pm line 887
BEGIN failed--compilation aborted at C:\Perl5\lib/KA/Administrator.pm line
67.
Connection closed by foreign host. 


Now then.  ODBC.pll is located in that directory, we're running ODBC
version 3.0, and the program runs fine from the command line.  Permissions
are full control for the ODBC.pll file.

I've written a one-line program that fails as well:

use Win32::ODBC;

That's all it takes to produce the error message.
Note that it runs fine from the command line, but not at all from the web
server.

I've printed out @INC, and %ENV from both the web and the command line -
both @INCs are identical, and while %ENV were different, I didn't see
anything important missing.

We're really at a loss here, and our server is down until this is fixed, so
any ideas would be much appreciated.

Thanks,
Darren

dgibbons@oroad.com
--
gordon ross                                        __o           /   \e/
electronic publications - the peak                `\ <,   __o   /     I
canada's first university html newspaper          0/ 0   `\-\, /     `\\, 
http://www.peak.sfu.ca  - peak@sfu.ca    	         0/ 0 /      0/ 0


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

Date: Mon, 21 Apr 1997 02:39:28 -0400
From: "Daniel F. Higgins" <dhiggins@netbiz.net>
Subject: Re: Who will win?  Borland or Microsoft or Programmers? *A Series Response*
Message-Id: <335B0BA0.1B43@netbiz.net>

Christopher B. Shires wrote:
> 
> M A wrote:
> >
> > Hi,
> >         My company is planning to start a project.  We have a big question
> > about our investments.  We don't know if we should use Microsoft
> > compiler or Borland.  Some myth we heard over the net.
> >
> > 1) 90% of the programmer uses Microsoft Compiler.
> > 2) Borland will vanish in 2 years (NASDAQ:BORL)
> > 3) Borland has better compiler
> > 4) 99% of the College in US have/use Borland Compiler.
> >
> > Some one show us the way?
> >
> > I myself use Borland Compiler and haven't thought about Microsoft yet!
> 
> Well, It's preety apparent that Borland is going down the tubes fast. I
> myself own Borland compilers for C++ for DOS and Windows.
>         For your company investments, I would have to say (and not willingly
> either) that it may be MicroSoft that you may want to take a look at,
> and for that I say is because basicaly Microsoft's stuff has the higher
> level of compatibility for most of the platforms you'll support. Yet I
> would also advise you to take a look into other company's as well such
> as GNU, Symantec, and others, just to see if any other of the
> alterntives are availible at a much more efficient cost.
> 
>                 CBS.



Does anyone use WatCom?

	I too use Borland, if Watcom has a nice interface, Id use that.. now if
someone would comeout with a complier with a tabbed window editor (and a
great compiler), that would be great (instead of this cascading windows
crap)

Daniel F. Higgins
http://www.fsu.umd.edu/students/dhiggins/index.html


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

Date: Wed, 23 Apr 1997 12:31:45 -0700
From: chas@aol.com
Subject: Re: Who will win?  Borland or Microsoft or Programmers?
Message-Id: <335E63A1.3967@aol.com>

What the hell does this have to do with all these irrelevant news
groups.
Someone stop cross posting.

chas@aol.com wrote:
> 
> mac@macsofta.com wrote:
> >
> > > M A wrote:
> > >
> > > Hi,
> > >         My company is planning to start a project.  We have a big question
> > > about our investments.  We don't know if we should use Microsoft
> > > compiler or Borland.  Some myth we heard over the net.
> > >
> > > 1) 90% of the programmer uses Microsoft Compiler.
> > > That's absoutly untrue for now and future..
> > ---90% uhh, since when.  I just looked up TRST report and that says 50%
> > Microsoft, 30% Borland, and 20% all others...
> 
> Sounds Good!
> > > > 2) Borland will vanish in 2 years (NASDAQ:BORL)
> > > Borland's bad finicial situation was issused four years ago,  somebody
> > > said Borland will vanish in 2 years, and 4 years passed, look what's
> > > happening?
> >
> > That won't happen.  Look at Netscape.  It is still alive and running
> > faster then ever.
> Boland is the technological leader and can't vanish in 8 years.
> > > > 3) Borland has better compiler
> > > Well, they have the fastest compiler for C++ (C++Builder), TOP
> > > RAD(Delphi) and Very Very Fogotten but a very very professional and
> > > powerful Visual dBase..  Actually, they have better compiler..  But
> > > language itself is not only compiler..(Forget I didn't metion both
> > > Borland and Microsoft doesn't support mulitiple-platform, yet..)
> >
> > Entera or what ever from Borland will set the standard for next 10
> > years.
> What is Entera?
> > > > 4) 99% of the College in US have/use Borland Compiler.
> > > That's absoutly untrue, either..
> > Well it more like 80%.
> Do I care.
> > > If you want to choose project between Borland and Microsoft, my
> > > suggestion is depended on what do you actually need.  Actually, if you
> > > wnat to make DOS-GAMES, window PE and all kinds of mutiple-platform PC
> > > apps, choose Borland C++ 5.1 (VC++ doesn't support these platform
> > > anymore..)  if you want RAD, choose Delphi.  If you are using MS-Office
> > > (which is the top office suite), choose VB.  If you have a bunch of
> > > people accustomed to MFC class library, choose VC++..
> > >
> > > And also, if you are using Linux, UNIX, X windows, SUN, and others, IBM
> > > visual Age is the best choice..
> > >
> > > >
> > > > Some one show us the way?
> > > >
> > Don't worry about the size of Microsoft.  Your company need productivity
> > so go for Borland.  After all if you have a good product it will make up
> > all the investment during the first 6 month.  I have seen project
> > written in VB and VC.  I know the difference it make. Don't let
> > Microsoft wash your brain.  They are only good and Marketing and hypeing
> > the shit out of a product.  MacOS is much superior then Win97.  Se ya
> Wait a min.  If you say UNIX 6 VS NT 4.1 then I would agree.


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

Date: Wed, 23 Apr 1997 12:29:02 -0700
From: chas@aol.com
Subject: Re: Who will win?  Borland or Microsoft or Programmers?
Message-Id: <335E62FE.3D10@aol.com>

mac@macsofta.com wrote:
> 
> > M A wrote:
> >
> > Hi,
> >         My company is planning to start a project.  We have a big question
> > about our investments.  We don't know if we should use Microsoft
> > compiler or Borland.  Some myth we heard over the net.
> >
> > 1) 90% of the programmer uses Microsoft Compiler.
> > That's absoutly untrue for now and future..
> ---90% uhh, since when.  I just looked up TRST report and that says 50%
> Microsoft, 30% Borland, and 20% all others...

Sounds Good! 
> > > 2) Borland will vanish in 2 years (NASDAQ:BORL)
> > Borland's bad finicial situation was issused four years ago,  somebody
> > said Borland will vanish in 2 years, and 4 years passed, look what's
> > happening?
> 
> That won't happen.  Look at Netscape.  It is still alive and running
> faster then ever.
Boland is the technological leader and can't vanish in 8 years.   
> > > 3) Borland has better compiler
> > Well, they have the fastest compiler for C++ (C++Builder), TOP
> > RAD(Delphi) and Very Very Fogotten but a very very professional and
> > powerful Visual dBase..  Actually, they have better compiler..  But
> > language itself is not only compiler..(Forget I didn't metion both
> > Borland and Microsoft doesn't support mulitiple-platform, yet..)
> 
> Entera or what ever from Borland will set the standard for next 10
> years.
What is Entera? 
> > > 4) 99% of the College in US have/use Borland Compiler.
> > That's absoutly untrue, either..
> Well it more like 80%.
Do I care. 
> > If you want to choose project between Borland and Microsoft, my
> > suggestion is depended on what do you actually need.  Actually, if you
> > wnat to make DOS-GAMES, window PE and all kinds of mutiple-platform PC
> > apps, choose Borland C++ 5.1 (VC++ doesn't support these platform
> > anymore..)  if you want RAD, choose Delphi.  If you are using MS-Office
> > (which is the top office suite), choose VB.  If you have a bunch of
> > people accustomed to MFC class library, choose VC++..
> >
> > And also, if you are using Linux, UNIX, X windows, SUN, and others, IBM
> > visual Age is the best choice..
> >
> > >
> > > Some one show us the way?
> > >
> Don't worry about the size of Microsoft.  Your company need productivity
> so go for Borland.  After all if you have a good product it will make up
> all the investment during the first 6 month.  I have seen project
> written in VB and VC.  I know the difference it make. Don't let
> Microsoft wash your brain.  They are only good and Marketing and hypeing
> the shit out of a product.  MacOS is much superior then Win97.  Se ya
Wait a min.  If you say UNIX 6 VS NT 4.1 then I would agree.


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

Date: Tue, 22 Apr 1997 19:15:34 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: "Terrence M. Brannon" <brannon@bufo.usc.edu>
Subject: Re: why cant I access/print a list-of-lists this way
Message-Id: <335D70C6.270@egames.com>

Terrence M. Brannon wrote:
> @vilist = ( [ $p, $s ] , [ $p, $s ] , [ $s , $p ] , [ $s , $p ] );
[...]
> foreach $vi (@vilist) {
[...]
>         $variant   = $vi[0]; # <--- this line
>         $invariant = $vi[1]; # <--- and this line both fail


$vi is a *reference* to an array, not an actual array,
so $vi[0] doesn't make sense.  What you want to say
is $vi->[0] or $$vi[0].

You need to go re-read Camel chapter 4 and/or man 
perlref again.  This notation is clearly explained in
both those references.

--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out, 
 you didn't want to know anyway..." --Larry Wall




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

Date: 23 Apr 1997 18:43:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Why perl/TK hardly mentioned in Camel Book?
Message-Id: <5jll7p$7lp$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Nathan V. Patwardhan
<nvp@shore.net>],
who wrote in article <5jj0sd$807@fridge-nf0.shore.net>:
> Dave Ripberger (dlrip@one.net) wrote:
> : Nothing about TK in the index, though I haven't completed the book
> : yet.  I also see very few posts and zero responses in
> : comp.lang.perl.tk.  What gives?  Is tcl/tk still the "choice" of perl
> : programmers?
> 
> pTk is only Unix-related, and although mentioned in a number of 
> Unix-centric books, is useless to those not using Unix.  

Interesting.  I should inform about this three different copies of
Perl/Tk (XFree86, Open32 and PM) which sit on the disk of my OS/2
machine.

Ilya


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 356
*************************************

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