[8078] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1697 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 21 18:07:37 1998

Date: Wed, 21 Jan 98 15:01:30 -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, 21 Jan 1998     Volume: 8 Number: 1697

Today's topics:
    Re: living and free software (was: Re: source into bina (John Stanley)
    Re: perl equivalent of stty...? (Martien Verbruggen)
    Re: PERL+ODBC vs Delphi for webwork scott@softbase.com
    Re: PERL+ODBC vs Delphi for webwork (Jeffery Chow)
        Perl, /bin/su question (**Jayaram Akula x3885 1C-326B (ibmgsu8yf))
    Re: readdir problem (Andrew M. Langmead)
    Re: Retreiving File from Remote Server (Martien Verbruggen)
    Re: Running Two Scripts at Once (brian d foy)
        Socket size in bytes <joelaff@laffey-stl.com>
    Re: source into binary code (John Stanley)
    Re: Why warn? (WAS: Re: Critique My Code! (Please)) (Martien Verbruggen)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 21 Jan 1998 21:05:48 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: living and free software (was: Re: source into binary code)
Message-Id: <6a5nvc$36p$1@news.orst.edu>

In article <54soqhhhde.fsf@gunnar.aladdin.net>,
Piers Cawley  <pdcawley@bofh.org.uk> wrote:
>20 Jan 1998 04:35:09 GMT stanley@skyking.OCE.ORST.EDU (John Stanley) comp.lang.perl.misc
>> Neither do I. But I don't consider commercial software to be useless
>> just because I had to pay for it.
>
>Heh, I don't consider free software to be worthless, that's why I
>often pay for it; A decent Linux distribution on CD is better value
>than the time I spend with my phoneline tied up waiting for it to
>download. 

Oops, the cat's out of the bag. Someone is violating the GPL. Or maybe
you aren't paying for the software after all?

>Hmm I don't think anyone (who hasn't amended their statement) has
>claimed to be making a living by giving away software. 

Of course nobody would claim that THEY are making such a living, because
they aren't. The claim was that it was possible.

>Lots of people
>have claimed to be making a living whilst giving away software, but
>that's a different matter.

Yes, that is a different matter, as I have already stated. Please don't
waste time arguing with me about things that you agree with me on.

>> >It is natural and normal to harbor contempt for those who cause
>> >trouble and are generally harmful to society.
>> 
>> Please support that statement with proof or retract it. It is a long
>> way from "I won't give you my code for free" to causing trouble for
>> society.
>
>Hmm... 'It is natural to harbour contempt for those who cause trouble
>and are generally harmful to society'. 

Repeating the statement is not providing support.

>Yeah, I can go with that. 

That's nice. Now provide proof that those who hoard code are harmful to
society.

>I'm
>not sure I believe that those who don't make their source available
>are either causing trouble or generally harmful to society, but it
>doesn't mean that the statement is incorrect.

So people who hoard code are not causing trouble, and the statement is
completely irrelevant in this discussion? You do remember that this
statement was in response to a statement about "code hoarders be damned"
or something similar? Are you saying that it doesn't really explain why
code hoarders should be damned?

>> The work is available to anyone who wants to use it. You cannot see how
>> it was done, just as I cannot walk into HP and expect to see how they
>> fab the chips for the calculator I just bought, nor can I learn how by
>> grinding the top off the chips in the one I bought. 
>
>But people can and do.

Please read the statement I made. First person. Yes, SOME PEOPLE get to
walk into HP and get the full tour with disclosure of proprietary
processes and such. That is hardly what I would call "free disclosure".

> The equipment needed is not exactly cheap, but
>the technique is reasonably well understood. Of course it would almost
>certainly work out cheaper just to buy the damn things from HP.

Yes, but when you have source sitting right in front of you, it is not
cheaper to buy the right to use to code from the author, it is a simple
matter of running the code.

>> >No one can benefit from what you've learned.  
>> 
>> Don't be silly. Anyone can benefit from what I've learned, they just
>> have to pay for it.
>
>Ah... anyone who can afford to can benefit from what you've learned.

Well, that is quite different from "no one", now isn't it?

>> The benefit is the operation of the program, not the ability to see
>> the code itself. 
>
>The risk is that the code will have bugs at some inappropriate time
>when you are not around to fix it. 

Of course there are those risks. I think it is a much greater risk if
the technician employed by the hospital to install PC's tries to fix the
MRI code than if they had to wait to call GE. Or what if the business
owner tries to fix the code, and uses ">file" to open a critical file
instead of >>? What is the cost of doing a restore from last backup?
What if the tinkerer doesn't notice the problem until he's cycled
through several backups and the file is gone? 

>> Did you notice that there is a thing called "tuition" at most
>> schools? Do you resent all those professors who expect to be paid to
>> teach you the things they have learned?
>
>Me? Nah, it's easier and more effective to pay them to do the teaching
>than it is to go buy the coursebooks and plough through them unaided.

So people who make you pay to find out things they have learned are ok
after all.

>> Did you also notice that most of the world would not benefit one tiny
>> bit by seeing the code, but many may benefit from its use?  E.g., the
>> code that runs the MRI systems sold by GE. I would get no benefit from
 ...

>You keep using this argument, I'm not sure it means what you think it
>means. Of course the doctors won't benefit from seeing the code.
>They're almost certainly bright enough to know this and if they did
>have access to it they wouldn't go near it. 

Please show me in the definition of "free software" the part that says
that only those who are bright enough to know they shouldn't touch the
code may get copies of the source. If you are going to argue a policy,
you have to argue the warts, too.

>It doesn't mean that I wouldn't be interested in seeing said code,
>they may have used some clever technique of which I was previously
>unaware that I can borrow and use in a completely different
>application.

Yes, you mean that you can use someone's intellectual property without
paying for the development of that property. And who is going to stop
you from using this in a competing application? Yes, copyright and
patent law will allow them to sue you if you do, but that is a costly
and time-consuming process that is much better to avoid.

>Um... I think you're being a little extreme. Just because you don't
>contribute to human knowledge doesn't make you a useless member of the
>wider society. 

Then not contributing to human knowledge isn't such a bad thing. Ok,
that's all I wanted to hear someone admit. 

>> Had an MRI recently? Used a modem? 
>
>> Those greedy software hoarders at Hayes...
>
>Well, they did try and sue people over using the AT command set so we
>ended up in a nightmare scenario where there was no standard way of
>accessing the more advanced features of any given modem, which was
>definitely a Bad Thing. 

And now explain why it is bad that they don't give every purchaser a
copy of the source to the modem code. Tell my how YOUR benefit from
using a modem is lessened because you don't have source.  That's the
question at hand.



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

Date: 21 Jan 1998 22:18:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl equivalent of stty...?
Message-Id: <6a5s8j$4lk$4@comdyn.comdyn.com.au>

In article <slrn6cdh11.4at.mmj@masskara.philonline.com.ph>,
	mmj@masskara.philonline.com.ph (Michael J. Maravillo) writes:
> I have the following line in my code:
> 
>   system("/bin/stty echo -raw > /dev/ttyS0 < /dev/ttyS0");

You might want to have a look at Term::ReadKey. It's not 'pure' perl
insofar that it uses some stuff written in c to do the low level
stuff. But it has a perl interface.

While you're there, check out some of the other Term modules as well.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


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

Date: 21 Jan 1998 19:54:06 GMT
From: scott@softbase.com
Subject: Re: PERL+ODBC vs Delphi for webwork
Message-Id: <6a5jou$mjg$1@mainsrv.main.nc.us>

Some guy wrote:

> We have a paradox7 database...

> I've implemented a stopgap solution using PERL32 and the ODBC
> library, but the ODBC driver we're using (by MS, came bundled
> with Office97 Dataacc package) is failing with an obscure error
> that MS won't solve for me.

Notes on this problem:

1. Other Perl Win32 stuff like Automation is screwy at best -- is this
ODBC stuff really reliable and bullet proof?  Enough you'd bet your job
on it? I didn't think so.

2. The ODBC standard and what databases actually support is two
different things. I've seen partial support for the full API before.
Access, for example, doesn't support Binary types. (Or didn't,
I think newer versions do.) Anyway, if this feature is obscure,
does the database even support it?

3. Paradox is the worst database ever written, I'm convinced.  If it
works at all I'd be shocked.  (Yes, I do speak from bitter personal
experience.) Move all this over to a real database and try it. If
you're using ODBC, all you should have to do is replicate the tables,
and that should be possible using an ODBC<->ODBC link of some sort.
Anyway, get rid of Paradox as quickly as possible!

4. Since when is it MS's job to solve your problems in an ODBC driver
they probably licensed from a third party and don't support
themselves?  Expecting them to is pretty silly, given their overall
track record in this department. (Since you didn't explain this
"obscure error", I'll wait for an explanation before I believe it
exists and it is a bug in the driver and not something else. Most ODBC
drivers come from InterSolv, and they do a pretty good job.)

5. Anyway, you get what you pay for. The free driver doesn't
work, and the $$$ one does. Hmmm, that's surprising!

6. Doesn't *PARADOX* come with an ODBC driver? I'm shocked it does not.
(Another sign of a real database is coming with a working ODBC driver.)

7. This Paradox junk is Borland's -- why don't you use Delphi and the
BDE? Borland lets ODBC take a backseat to its own database middleware
technology. They have native Paradox databas access in Delphi.

Show us some code and DDL.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 21 Jan 1998 22:07:18 GMT
From: jefferyc@unixg.ubc.ca (Jeffery Chow)
Subject: Re: PERL+ODBC vs Delphi for webwork
Message-Id: <6a5rim$qgt$1@nntp.ucs.ubc.ca>

Scott and Everyone,

: 3. Paradox is the worst database ever written, I'm convinced.  If it

I agree, but dumping Paradox isn't a recommendation I'm entitled to make.


: 4. Since when is it MS's job to solve your problems in an ODBC driver
: they probably licensed from a third party and don't support
: themselves?  Expecting them to is pretty silly, given their overall
: track record in this department. (Since you didn't explain this
: "obscure error", I'll wait for an explanation before I believe it
: exists and it is a bug in the driver and not something else. Most ODBC
: drivers come from InterSolv, and they do a pretty good job.)

Intersolv also charges $5000 for a server license for their DataDirect 
drivers. Arm? Leg?
The error I'm getting is a -5029 from their ODBC driver, with the message
"there is no message for this error".


: 7. This Paradox junk is Borland's -- why don't you use Delphi and the
: BDE? Borland lets ODBC take a backseat to its own database middleware
: technology. They have native Paradox databas access in Delphi.

That appears to be the best solution so far. I did look up MS's InterDev 
but I guess that uses ODBC as well. However, X years down the road, when 
my boss does want to migrate towards something more powerful, we'd have to
change the backend as well as the existing Delphi stuff...not very 
attractive.

Jeff
--
|======================================================|
| Jeffery Chow   4th year Computer Science, UBC        |
|------------------------------------------------------|
| http://www.ugrad.cs.ubc.ca/spider/j8g1/fdoor.html    |
| "Here lives a competent, trustworthy salesman of     |
|  propane and propane accessories." -- H. Hill        |
| This message brought to you by Bill Gates, inventor  |
| of DOS, the World Wide Web, and the modern GUI.      |
|======================================================|


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

Date: 21 Jan 1998 20:52:43 GMT
From: jayu@voivod.cb.att.com (**Jayaram Akula x3885 1C-326B (ibmgsu8yf))
Subject: Perl, /bin/su question
Message-Id: <6a5n6r$ddr@nntpa.cb.lucent.com>

Hello,

I'm trying to run the following script ( misc portions not shown ) on 
a solaris 2.5.1 m/c as root. The idea is to invoke "xlock" with the uid
of the user who's logged in at the console. 
	# both commands "system" and "open" bring up the xlock with root
	# as the owner.   

Is there a better way to do this.

any help on this is greatly appreciated.

Thanks in advance:

Jay

jakul@yahoo.com

=============================================================
#!/bin/perl 
#
# Try to get the name of the user on console;
#($name,$passwd,$uid) = getpwnam(&whois_on_console);
#$>=$uid;
#$<=$>;	( This does'nt work as the setreuid() is disabled on solaris2.5.1 m/c
		So trying to use /bin/su )

#system "/bin/su ${name} -c /usr/openwin/bin/xlock";

#open(LOCK,"/bin/su ${name} -c /usr/openwin/bin/xlock|")|| \
	warn "could not run xlock";

=============================================================

-- 
Jayaram Akula
(614)-860-3885


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

Date: Wed, 21 Jan 1998 22:22:38 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: readdir problem
Message-Id: <En5nHq.B6n@world.std.com>

bart.mediamind@tornado.be (Bart Lateur) writes:

>Calle Dybedahl <qdtcall@esb.ericsson.se> wrote:

>>$dir=".";
>>opendir DIR,$dir or die "Can't open $dir: $!\n";
>>chdir $dir;
>>@sorted_list = sort {-M $a <=> -M $b } readdir DIR; # Not the fastest possible
>>                                                    # way to do it.

>Then, what is? I've though of storing -M $file into a hash for each
>file, and then sort them by value. Untested code:

That will be a huge speedup, although you may get even greater gains
by using a two dimensional array or two parallel arrays. One common
way of way of creating a two dimensional array, sorting it and
retrieving the result is the "Schwartzian Transform" from the FAQ
(which you can read on a PC by choosing "Find Files or
Folders"... whoops that was the other thread wasn't it.)

Actually, it was the construct "{ -M $a <=> -M $b }" that Tom
Christiansen once referred to as "pessimal sorting" in an article
titled "Re: Read directory in timestamp order?" 
Message-Id: <4l36f0$ghg@csnews.cs.colorado.edu>. (Although the person
who posted the "{ -M $a <=> -M $b }" said that he could show an
example of "really pessimal" coding) The article was very
interesting. Far more readable and informative than either the FAQ
entry, or the article "Far More Than Everything You Every Wanted to
Know About Sorting" <URL://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html>

-- 
Andrew Langmead


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

Date: 21 Jan 1998 22:17:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Retreiving File from Remote Server
Message-Id: <6a5s5a$4lk$3@comdyn.comdyn.com.au>

In article <6a3pqt$3rs@bgtnsc01.worldnet.att.net>,
	John Kotwicki <Webmaster@csa.clpgh.org> writes:

> The code I use after the connection is made is:
> 
> 	print S "GET $url HTTP/1.0\n\n";
> 
> 	while ($_ = <S>) {
> 		print $_;
> 	}

Why? Use the LWP modules. LWP::Simple comes to mind for something like
this.

If you absolutely have to send raw HTTP, then you should not be asking
this question on a perl newsgroup, but a HTTP one. Oh, and read the
HTTP 1.0 and 1.1 specifications (RFCs). Whatever HTTP servers return
or expect is not a perl issue.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Wed, 21 Jan 1998 17:53:32 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Running Two Scripts at Once
Message-Id: <comdog-ya02408000R2101981753320001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34c4d59a.1999949@nntp.harborcom.net>, kschreff@harborcom.net (Schreffman) posted:

>        Can this be done?  I have a HTML form that when submitted, I
>want to split the browser window into two frames and run a perl script
>that will display data in each frame.  Any ideas or hints???

see the CGI Meta FAQ to find out that you can't target two separate
frames in one HTTP response.  

and, as this is perl independent, you might want to take further
discussion to comp.infosystems.www.authoring.cgi

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Wed, 21 Jan 1998 15:09:20 -0600
From: Joe Laffey <joelaff@laffey-stl.com>
Subject: Socket size in bytes
Message-Id: <Pine.NEB.3.95.980121150534.579A-100000@maat.fastrans.net>

I am trying to find a way to determine the number of bytes waiting in a
socket. In fact, I am really trying to find a way to check to see if there
are ANY bytes waiting in a socket.

I want to constantly copy the contents of one socket to another and vice
versa. I cannot use fork (runs on a Mac). If I can check to see if a
socket is empty then I can NOT call sysread on it. The problem is that if
I do call sysread and the socket is empty it just hangs there waiting for
data, until it gets some.

I have tried using the -s function on the socket, and all I get is a value
of 1 regardless how much data (or no data) is in the socket.

Please CC to e-mail.

Thanks!

Joe Laffey
LAFFEY Computer Imaging
St. Louis, MO
joe@laffey-stl.com
http://www.laffey-stl.com/imaging/

------------------------------------------------------
    Think your machine is wicked fast?  Prove it!
   Visit http://rc5.distributed.net  and join the 
 effort to prove the necessity of strong encryption!
------------------------------------------------------



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

Date: 21 Jan 1998 21:38:23 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <6a5psf$mh0$1@news.orst.edu>

In article <Pine.OSF.3.95.980121122328.31207h-100000@primal.ucdavis.edu>,
Jason Christian  <jason@primal.ucdavis.edu> wrote:
>On 21 Jan 1998, John Stanley wrote:
>
>> In article <Pine.OSF.3.95.980120170623.31207c-100000@primal.ucdavis.edu>,
>> Jason Christian  <jason@primal.ucdavis.edu> wrote:
>> >> You will either pay the licensing fee or not. You don't get to set the
>> >> price for my code. I do.
>> >
>> >No you don't.

>> When you tell me that I do not get to set the price I charge for my
>> services, there is nothing left to discuss.
>
>I agree with the conclusion.  But when you quote part of a line, and
>throw away the rest, then you come awfully close to lying.  The
>original lines read: 

I quoted the entire sentence, the topic sentence of your paragraph. If
you don't like that, don't make it a complete sentence and don't make it
the topic of your paragraph. The rest of your paragraph should support
your first sentence, and since your first sentence is patently
ridiculous, there was no need to go further. However, since you want to
make claims of lying and dishonesty, let's deal the rest of your
paragraph, too. It should have been obvious, but I guess I need a 2x4.

><QUOTE>
>No you don't.  No I don't.  There are various levels and amounts of
>software services that I am willing to buy at various prices. 

Irrelevant. If you don't want to pay the price I set, then you don't
get the services. Period. End of sentence. But you keep going...

>You have a similar relationship for your supply of software (services).

We are talking about software I write. I am the supply. But, just like
you, if I need to buy something from a source, I don't set the price. If
I don't want to pay what he wants me to pay, I don't get whatever it is
I wanted to buy. The source may haggle over the price, but in the end,
it is the price he will accept that is what I pay, not the price I offer
(unless the latter is higher than the former, of course.)

>Your unwillingness to release source code, while your right,
>influences
>my willingness to buy.  

Of course it does, but irrelevant. You don't want to pay what I ask, you
don't get what I'm selling. It's a simple concept, but you continue...

>I will pay a lot more for the same
>functionality if I have access to the code.  

Good for you. But you will pay at least what I say you will pay or you
don't get the code. I set the price. Even more you go on ...

>*I* am willing to accept
>a covenant against reuse of code by others other than myself or my
>agents...but I do need to be able to show the code to programmers who
>come for me later.

That's nice, but again, irrelevant. If you don't want to pay the price
I am asking, then it doesn't matter what covenant you are willing to
sign, you don't get anything. I may set a lower price for someone who
signs such a covenant, but I will say it again, I set the price, not
you. Do you get the message yet?

>You have no more ability to coerce me into buying at a price that I

I didn't say I had ability to coerce you to do anything, I said I set
the price, not you. If you don't like the price, you don't have to buy
anything. You can go somewhere else.

>Your surgery on my line is dishonest.  

<plonk>



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

Date: 21 Jan 1998 22:12:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Why warn? (WAS: Re: Critique My Code! (Please))
Message-Id: <6a5rs3$4lk$2@comdyn.comdyn.com.au>

In article <885397068.1110573072@dejanews.com>,
	dg50@chrysler.com writes:

> So then, if warn also raises __WARN__, then its use involves more
> overhead then plain old print STDERR - assuming one is not interested in
> a __WARN__ handler of some sort.

Yep. Just like using a module, or OO concepts in programming incur
more overhead. But the tradeoff is that you end up with code which is
easier to maintain, reuse and port. I personally never really worry
too much about the overhead of this sort of thing. Getting rid of this
type of overhead might speed up your code by about 0.3 nanoseconds.
Not worth mentioning :)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

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 1697
**************************************

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