[9041] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2659 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 21 09:07:32 1998

Date: Thu, 21 May 98 06:01:03 -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           Thu, 21 May 1998     Volume: 8 Number: 2659

Today's topics:
    Re: ?access NT-SQLserver  from Linux? <arturcz@kerigma.cyf.gov.pl>
    Re: Flat-File db recommendation <jhoglund@mirage.skypoint.net>
    Re: GNU attacks on the open software community. <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
    Re: GNU attacks on the open software community. <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
    Re: GNU attacks on the open software community. <JYoungman@vggas.com>
    Re: GNU attacks on the open software community. <tchrist@mox.perl.com>
    Re: GNU attacks on the open software community <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
    Re: GNU attacks on the open software community <JYoungman@vggas.com>
    Re: GNU attacks on the open software community <zenin@bawdycaste.org>
    Re: GNU attacks on the open software community <tchrist@mox.perl.com>
    Re: GNU attacks on the open software community (le Fanttme)
    Re: GNU attacks on the open software community (le Fanttme)
    Re: GPL documentation == unspeakable evil <JYoungman@vggas.com>
    Re: GPL documentation == unspeakable evil <JYoungman@vggas.com>
    Re: GPL documentation == unspeakable evil <tchrist@mox.perl.com>
    Re: GPL documentation == unspeakable evil <tchrist@mox.perl.com>
    Re: Problem de-referencing a reference to a typeglob st <bobklin@idt.net>
    Re: Problem de-referencing a reference to a typeglob st <tchrist@mox.perl.com>
    Re: simple help with one-liner needed (newbie question) <thor@eznet.net>
    Re: sort array of hashes (Irene Barg)
        strange behaviour of PERL <teilipe@tss.tei.ericsson.se>
    Re: strange behaviour of PERL <zenin@bawdycaste.org>
    Re: strange behaviour of PERL <tchrist@mox.perl.com>
    Re: What is wrong with this FileHandle code? <jim.michael@gecm.com>
    Re: What is wrong with this FileHandle code? <tchrist@mox.perl.com>
    Re: Writing to files <zenin@bawdycaste.org>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 21 May 1998 12:34:02 GMT
From: "Artur R. Czechowski" <arturcz@kerigma.cyf.gov.pl>
Subject: Re: ?access NT-SQLserver  from Linux?
Message-Id: <6k16vq$on3$2@kerigma.cyf.gov.pl>

In comp.lang.perl.misc Jim Westveer <jwest@netnw.com> wrote:
> Any words of wisdom on ways to access NT-SQLserver  from Linux?
See topic: From Linux/perl to MS SQL in comp.lang.perl.misc.

Followup-To: comp.lang.perl.misc

Regards
-- 
Artur R. Czechowski <arturcz@kerigma.cyf.gov.pl>
See http://pgp.icm.edu.pl/pks/ for PGP public key
http://kerigma.cyf.gov.pl/~arturcz/


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

Date: 21 May 1998 12:46:55 GMT
From: Jamie Hoglund <jhoglund@mirage.skypoint.net>
Subject: Re: Flat-File db recommendation
Message-Id: <6k17nv$ese$3@shadow.skypoint.net>

Bob Bacola <bobbacola@pipeline.com> wrote:
: This has probably been asked many times but is a RDBMS like MySQL required
: to search a large flat ascii file (43 megs, 136,000 rows) or does perl and
: or unix have enough built in power?

: I currently search this file using  the grep command in AIX 3.2.5 which is
: very slow as you can imagine since it searches every character in the file.
: Could perl be setup to search by an index somehow?  Thank you for any help.

There is a module called Dict.pm somewhere, (Search::Dict.pm  I think?) 

What I've done in the past is setup the DB_File routines as an index to
a flat file, (using several of them keyed on a varous field, holding a
seek position) there are also binary search routines here & there that
are available. Problem is when you get into multiple non-unique keys, you 
have to play a lot of games, but it is possible, also the indices have to
be kept up to date.

If you're only requirement is 1 unique key, then you could pack the whole
thing  into a dbm, filesize gets kind of large though.

If the file is sorted, the look command (if present) can locate items
quickly too. (perl optional. :-) )

Jamie

-- 
 -------------------------------------------------------------------------
 jamie@lecart.com
 http://www.lecart.com 


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

Date: 21 May 1998 13:37:40 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: GNU attacks on the open software community.
Message-Id: <m2u36jx3az.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>

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

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, Ron House <house@usq.edu.au> writes:
> :And I think the confusion was most
> :likely intended. "Hey, I want to give my code away free!"
> :"Great! Use the GPL - it covers free software!" And the
> :person gives away something other than what they intended.
> 
> That's right -- they have surrendered their freedom.  They are now *less*
> free than they were.

No, they still have the right to do whatever they want with their
code.  They have, however, given others freedom in accessing that
code.  That way they have lost power: people need not come to them in
order to do certain things with their code.

Releasing under the GPL does not take away any of your freedoms.  It
does take away power, including the power to perpetually control the
destiny of the code.

>  It's a semantic trick, mildly clever but underhanded.
> And enforcing this perversion on programming documentation is, if you
> will forgive me for indulging in well-justified conspiracy musings,
> also part of their plot, a plot that I feel Perl should have no part in.
> Perl has never told people what to do before, and it should not now.

Why then is it not released in the public domain?


-- 
David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany


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

Date: 21 May 1998 13:40:07 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: GNU attacks on the open software community.
Message-Id: <m2som3x36w.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>

Ron House <house@usq.edu.au> writes:

> chris+usenet@netmonger.net wrote:
> 
> >  He is mad at O'Reilly because they sell
> > a lot of books about GNU software but they don't donate anything to
> > the FSF.
> 
> Is FSF s'ware free, or is that just propaganda?

There is a difference between wanting people to do the right thing,
and forcing people to do the right thing.


-- 
David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany


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

Date: 21 May 1998 12:06:09 +0100
From: James Youngman <JYoungman@vggas.com>
Subject: Re: GNU attacks on the open software community.
Message-Id: <u11ztn7uji.fsf@noisy.vggas.com>

>>>>> "tc" == Tom Christiansen <tchrist@mox.perl.com> writes:

  tc> In comp.lang.perl.misc, Ron House <house@usq.edu.au> writes:
  tc> :And I think the confusion was most
  tc> :likely intended. "Hey, I want to give my code away free!"
  tc> :"Great! Use the GPL - it covers free software!" And the
  tc> :person gives away something other than what they intended.

  tc> That's right -- they have surrendered their freedom.  They are
  tc> now *less* free than they were.

No they are not.   They are still the copyright holders for the work
in question and have not surrendered any rights at all.   The fact
that their work has been published under the GPL doesn't prevent them
sibsequently publishing it under other licenses later, or prevent them
from exercising any of their other rights either.



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

Date: 21 May 1998 12:11:14 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community.
Message-Id: <6k15l2$5nf$4@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> writes:
:There is a difference between wanting people to do the right thing,
:and forcing people to do the right thing.

Bingo.  

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: 21 May 1998 13:30:12 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: GNU attacks on the open software community
Message-Id: <m2vhqzx3nf.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>

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

> In comp.lang.perl.misc, Andi Kleen <ak@muc.de> writes:
> :What lies? When I can't modify something to suit my needs it is not 
> :free for me. 
> 
> The lie that Perl's documentation is not free.  It is.  Saying otherwise
> is a lie.  Stop lying.  Also, the lie that you can't modify to suit your
> own needs.  You can.  Saying you can't is a lie.  You can do anything
> you want for *your*own*personal*use*.  I'm just tired of being screwed by
> wannabe book authors stealing from me, Larry, and the rest of the authors.

Please read the definition of "free" the FSF uses for software on
their relevant pages.  This is gnu.misc.discuss, so a passing
acquaintance with their terminology might be assumed.  "Free" for them
includes the freedom to change as necessary.  The GPL is designed as a
license that does not bind future versions by necessity to the
original author.

As long as your manuals are released with the requirement that they
not be changed, everything relies by force on you.  If you happen to
change your interests, die, get lazy, whatever, people will be
screwed.  They will be stuck with a large corpus of documentation that
can no longer be updated to accomodate Perl developments.  Free
software is about the possibility of sharing and changing work.  This
philosophy of the FSF has been kepy up, even when it turned against
their immediate wishes (see XEmacs development, see egcs development).

> Whoever claims otherwise is spreading fear, uncertainty, and doubt.
> They are working to divide our community.  They are committing an evil
> that should be revealed to the light, extirpated from our midst--burnt
> out.

> Could you possibly tell me whatever happened to pure simple social
> decency of *asking* the author about his work?  Authors of free software
> and free documentation are famous for the receptivity to these things.
> 
> :Of course it is nice of you that you make your documentation available
> :at no cost, but please don't claim that it is free. 
> 
> I recognize (or at least strongly suspect) that you are not a native
> speaker of English, and that in German, frei doesn't mean the same as
> it does in English.  So I forgive you.
> 
> But my stuff is indeed free.  It's totally gratis, a gift.  That's
> free.

America has been known to be a nation fighting for freedom.  I don't
think that this has been a fight for gratis products.

> If you call it anything else, you're confused or lying.  But you're just
> not free to screw me over with it.  That's thievery.

The FSF is not calling for screwing you over it.  It is calling for
people to perhaps try to generate an independent work that would
fulfil the same purpose, but be no longer connected exclusively to the
well-bearing of a single person.  Or it is calling for you to release
the documentations in a form that is more free.

> It's really a matter of being a decent human being and respecting
> other people's authorship rights.  If you want something changed, ask. 
> If you want into my house, ring the door bell.

They don't want into your house.  They want to have a house built
where one does not need to ring the bell and hope for an answer from a
single person.


-- 
David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany


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

Date: 21 May 1998 12:02:40 +0100
From: James Youngman <JYoungman@vggas.com>
To: Zach Kessin <zkessin@shell1.tiac.net>
Subject: Re: GNU attacks on the open software community
Message-Id: <u14syj7upb.fsf@noisy.vggas.com>

>>>>> "zk" == Zach Kessin <zkessin@shell1.tiac.net> writes:

  zk> Tom C, please keep your docs as Is, I realy like them! (And I could
  zk> not function without my copy of the Cammel book).

Nobody at all is asking Mr. Christiansen to change the license on his
work even slightly.

Recap:-   
 1. The GNUs Buletin suggested the creation of Free-in-the-FSF-sense
    documentation for Perl.  This does not already exist.

 2. Mr. Christiansen was apparently offended by the implication that
    his documentation is not "free".



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

Date: 21 May 1998 12:03:47 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: GNU attacks on the open software community
Message-Id: <895752677.991101@thrush.omix.com>

Barry Margolin <barmar@bbnplanet.com> wrote:
: I don't think so.  The BSD license allows you to distribute binary-only
: copies, thus preventing users from modifying it to suit their needs.

	The BSD license allows you to distribute in source or binary, with
	or without modifications, so long as the copyright, list of
	conditions, disclaimer, and acknowledgements are included (about a
	page or two of text).

	If you wish to link commercial code with it, go ahead.  If you wish
	to "build a better BSD" and sell it, go ahead.  If you wish to print
	it all out and wipe you butt, go ahead.  So long as proper credit is
	included, do pretty much whatever you want with it, free,
	commercial, or otherwise.  It's "free" software in the sense that
	you're "free" to do whatever you fell like with it, the only
	restriction being pretty much to give credit where credit is due.

	GPL code is only "free" for "free use".  It's great for use where
	you don't ever want your code used for commercial use, but if you
	do it's a nightmare.

	I personally have a strong liking to open source software, however
	to ask all "free" software to live in an entirely different world
	from commercial software is pretty silly.  If Perl didn't have it's
	artistic license, I wouldn't be allowed to code in it right now.

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: 21 May 1998 12:06:05 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <6k15bd$5nf$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    trd@cs.mu.oz.au (Tyson Richard DOWD) writes:
:However, you convince everyone that there is true freedom when people cannot
:change what you have written.  

True freedom doesn't not involve coming to my home and trashing
it just because you feel like it.  I haven't seen rms freely posting
any of his phone card numbers, credit cards numbers, or bank account
numbers to the net lately so that we can all freely use them.

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: Thu, 21 May 1998 12:11:51 GMT
From: fantome/@/usa/./net (le Fanttme)
Subject: Re: GNU attacks on the open software community
Message-Id: <EA44D732C809E85F.D5F3548D06FFC45E.9F118B885760E0DC@library-proxy.airnews.net>

On Wed, 20 May 1998 21:24:58 -0400, Benjamin Holzman
<bholzman@mail.earthlink.net> wrote:

>> But what if someone makes a modification to perl, and then wants to make a
>> corresponding modification to the documentation?  Your prohibition against
>> modifying the documentation requires them to distribute *incorrect*
>> documentation.
>> 
>> Anyway, but RMS's definition of "free", something is not free if he's not
>> free to modify it.  The two most important freedoms he's working to promote
>> are the right to share software and the right to modify it.
>
>Documentation is not software.  If you make your own software based on
>perl, I see no reason why you shouldn't write all your own
>documentation.  Nothing prevents you from doing that.

One wouldn't need to write all your own documentation. One would be
able to write an addendum which describes the differences, which would
be sufficient.

-f
-- 
austin ziegler * fantome*@*vnet*.*net   * http://fantome.vnet.net/
---------------* aziegler*@*vcela*.*com * -------------------------
Remove the stars to email me            * Ni bhionn an rath ach
my words my opinions my ideas           * mar a mbionn an smacht
  -- I Argue Ideas, Not Beliefs: Give Up Your Dogma --


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

Date: Thu, 21 May 1998 12:48:55 GMT
From: fantome/@/usa/./net (le Fanttme)
Subject: Re: GNU attacks on the open software community
Message-Id: <A779D961FC83A498.488C45ACEA826249.18E75AA21878F851@library-proxy.airnews.net>

On 21 May 1998 06:50:28 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

> [courtesy cc of this posting sent to cited author via email]
>
>In gnu.misc.discuss, 
>    les@MCS.COM (Leslie Mikesell) writes:
>:I don't see how you can legally deliver an unaltered perl distribution
>:in any situation where profit is involved unless you separate perlfaq
>:or change the copyright to match perl itself.  
>
>Bundling the FAQ with the complete distribution is of course perfectly
>fine -- and mandatory.  I'm talking about people putting my FAQ in their
>own books and charging for it.  That I won't stand for.  If you want to
>distribute the FAQ *unbundled*, you must not charge more that it cost
>you to copy it.

It should be made clear that there could be a cumulative cost for
copying the FAQ unbundled with other documents unbundled. I don't read
Mr. Christiansen's restriction as limiting the price of the whole
CD-ROM, but I do see it as limiting the value which would be placed on
the perlfaq itself.

-f
-- 
austin ziegler * fantome*@*vnet*.*net   * http://fantome.vnet.net/
---------------* aziegler*@*vcela*.*com * -------------------------
Remove the stars to email me            * Ni bhionn an rath ach
my words my opinions my ideas           * mar a mbionn an smacht
  -- I Argue Ideas, Not Beliefs: Give Up Your Dogma --


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

Date: 21 May 1998 10:56:37 +0100
From: James Youngman <JYoungman@vggas.com>
Subject: Re: GPL documentation == unspeakable evil
Message-Id: <u17m3g6j6y.fsf@noisy.vggas.com>

>>>>> "tc" == Tom Christiansen <tchrist@mox.perl.com> writes:

  tc> It is imperative that no documentation be placed under the GPL
  tc> due to its insidious viral nature.

Well, I'm happy to retrospectively accomodate your wishes.   GNU
documentation carries this license:-


  	 Copyright (C) 1993, '94, '95, '96, '97 Free Software Foundation, Inc.
  
  	 Permission is granted to make and distribute verbatim copies of
  this manual provided the copyright notice and this permission notice
  are preserved on all copies.
  
  	 Permission is granted to copy and distribute modified versions of
  this manual under the conditions for verbatim copying, provided also
  that the section entitled "GNU Library General Public License" is
  included exactly as in the original, and provided that the entire
  resulting derived work is distributed under the terms of a
  permission notice identical to this one.
  
  	 Permission is granted to copy and distribute translations of this
  manual into another language, under the above conditions for
  modified versions, except that the text of the translation of the
  section entitled "GNU Library General Public License" must be
  approved for accuracy by the Foundation.
  


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

Date: 21 May 1998 11:51:41 +0100
From: James Youngman <JYoungman@vggas.com>
Subject: Re: GPL documentation == unspeakable evil
Message-Id: <u167iz7v7m.fsf@noisy.vggas.com>

>>>>> "tc" == Tom Christiansen <tchrist@mox.perl.com> writes:

  tc> If so, then this is wrong.  Perl will have no part of making
  tc> people's choices for them.  The documentation and modules are
  tc> *meant* to be copied.  Something that's meant to be copied
  tc> should not carry with it an infection that strips the author of
  tc> his artistic rights of authorship.  We must not make others'
  tc> decisions for them in this.

Nobody is doing that.  Nobody forces *anybody* to make a work derived
from GPLed code and distribute it.   That's *their* choice.   

Nothing about the GPL "strips the author of his artistic rights of
authorship".  The author of the GPLed work retains his/her rights over
their work, just as the author of the modifications retains their
rights over the modifications.   But the author of the modifications
has no rights over the original work, other than those that the
original author chooses to give them.  And that is as it should be.

And if the author of the original work wishes to make conditions on
when a derived work may be published, that is also their right.  After
all, their permission is required for this to be allowed.  Is it only
when those conditions take the form of the GPL that this is a problem
for you?   Or are there other licenses that you also find repugnant?




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

Date: 21 May 1998 11:57:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GPL documentation == unspeakable evil
Message-Id: <6k14qj$5nf$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    galibert@pobox.com (Olivier Galibert) writes:
:"Tom's  object-oriented tutorial for perl" and  the "How to embed perl
:in your C program" explicitely allow for the  use of the included code
:in any way. The rest of the documentation is under the GPLv1.

I will fix the FAQ licence so that it works like perltoot, which was
always my goal.  Once again, prose vs text is being confused.  My simple
goal is to help people use Perl, help them write software howsoever
they choose, to make their life better.  That is not the GPV goal.
To this effect, I write free Perl documentation (that's the real version
of free, not FSF free-with-strings-attached).  I'm not trying to sink
my hooks into them.  What they do with that software is up to them.
The ability to let others choose their own path is critical to me.

But I'll be damned if I'm going to make other people's moral choices.

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: 21 May 1998 12:00:32 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GPL documentation == unspeakable evil
Message-Id: <6k1510$5nf$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni) writes:
:So what is the problem?
:1. direct copying of examples to your non GPL program is forbidden.

I consider that a major problem.   

I have no right to force moral choices on others--or they cease to be
moral choices.  No one applauds the cow because it did not rise up and
slay the eagle.  Doing something you're forced into doing merits no
moral high ground.  It just means you've been forced to do things their
way.  This is contrary to the whole spirit of Perl--and public morals.
You can't legislate morality, and I shall resist all attempts to do so.

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: Thu, 21 May 1998 08:35:15 -0400
From: Bob Kline <bobklin@idt.net>
Subject: Re: Problem de-referencing a reference to a typeglob stored in a hash
Message-Id: <35641F83.F19B7ACA@idt.net>

I went back and read the FMTEYEWTK (several times) and I can
see that it explains what will work and what won't, but I haven't
yet found where it explains *why* the expression $x{FH} doesn't
produce something the <> operator understands.  Why doesn't
the hash notation produce the value for the key "FH"?  The
original poster had already figured out the workaround, but
it would be nice to be able to understand why expressions
don't behave the way one would expect them to.

Thanks.

Bob Kline

Tom Christiansen wrote:

> Alan Meyer writes:
>
> :Why should the expression <$x{FH}> behave differently
> :from <$x> ???
>
> I *know* I just explained this.  Please go back to the FMTEYEWTK on
> Indirect FileHandles posting form a few days ago.



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

Date: 21 May 1998 12:46:30 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Problem de-referencing a reference to a typeglob stored in a hash
Message-Id: <6k17n6$5nf$7@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, bobklin@idt.net writes:
:I went back and read the FMTEYEWTK (several times) and I can
:see that it explains what will work and what won't, but I haven't
:yet found where it explains *why* the expression $x{FH} doesn't
:produce something the <> operator understands.  Why doesn't
:the hash notation produce the value for the key "FH"?  

Because that's a glob.

    $x{FH} = "/bin/??";
    @files = <$x{FH}>;
    print "@files\n";

    /bin/cp /bin/dd /bin/df /bin/ed /bin/ex /bin/ln /bin/ls /bin/mt
    /bin/mv /bin/ps /bin/rm /bin/sh /bin/su /bin/vi

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: Wed, 20 May 1998 12:46:07 -0400
From: thor <thor@eznet.net>
Subject: Re: simple help with one-liner needed (newbie question)
Message-Id: <356308CF.F26007DD@eznet.net>

Tom Phoenix wrote:

> There's a little room for interpretation and improvement here, but this is
> what I'd probably use:
>
>    sub initials { join '', $_[0] =~ /\b(\w)/g }

i like it!

a warning about messing with someone's name though: some people
(namely authors 8^) are very sensitive about how their name is displayed.

having said that...

<script type=perl>
sub initials { join '', $_[0] =~ /\b(\w)/g }

foreach $fullname
    ( "Chris Croome", "Francois de LaCroix",
      "Francois de La Croix", "B-I-G B-A-D Wolf",
      "Tim Berners-Lee", "Ken Griffey Jr.", "Griffey, Ken, Jr." )
{
    print ( "$fullname -> ", initials ( $fullname ), "\n" );

}
</script>

produces:

Chris Croome -> CC
Tom Phoenix -> TP
Francois de LaCroix -> FdL
Francois de La Croix -> FdLC
B-I-G B-A-D Wolf -> BIGBADW
Tim Berners-Lee -> TBL
Ken Griffey Jr. -> KGJ
Griffey, Ken, Jr. -> GKJ


you might try these as well:

    sub initials { join '', $_[0] =~ /\b([A-Z])/g }

    sub initials { join '', $_[0] =~ /(?:\b(\w)|[^A-Z]([A-Z]))/g }

    sub initials { join '', $_[0] =~ /(?:\b([A-Z])|[^A-Z]([A-Z]))/g }



thor
god of thunder




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

Date: 20 May 1998 17:35:23 GMT
From: barg@nickel.as.arizona.edu (Irene Barg)
Subject: Re: sort array of hashes
Message-Id: <6jv48r$p5c$1@news.ccit.arizona.edu>

Hell all,

Thanks to everyone who responded with suggestions regarding my earlier
posting.  Two solutions that worked for me were suggested my many, but
as A.L. wrote:

-->Your sort statement needs a little correction

-->@myLoH = sort { $a->{'rel_focus'} <=> $b->{'rel_focus'} } @LoH;


-->But the "Schwartzian transform" is the recommended way:

-->@myLoh = map  { $_->[0] }
-->         sort { $a->[1] <=> $b->[1] }
-->         map  { [$_, $_->{'rel_focus'}] } @LoH;

Both worked.  Yes, I had seen reference to the "Schwartizian transform"
on the Perl FAQ, but I just didn't understand it enough to try it.

Many thanks, I'll make my deadline after all!
--irene

-------------------------------------------------------------------
Irene Barg			Email:	ibarg@as.arizona.edu
Steward Observatory		Phone:  520-621-2602
University of Arizona		FAX:    520-621-1891
Tucson, AZ  85721		http://nickel.as.arizona.edu/~barg
-------------------------------------------------------------------





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

Date: Thu, 21 May 1998 10:28:20 +0200
From: Peng Li <teilipe@tss.tei.ericsson.se>
Subject: strange behaviour of PERL
Message-Id: <3563E5A4.8D0C5267@tss.tei.ericsson.se>

I should misunderstand of PERL. Just one stupid question.

I have an array, if I use default stack to extract the array
element : foreach (@array), if inside the loop I calling other
function which use the stack. After that, the array has been
changed eventhought I declare with "my".
Here are the source code:

#!/usr/local/bin/perl
 
sub func {
   $_ = 100;
}
 
 
my @array = (1,2,3);
 
print "before calling func\n";
foreach ( @array ) {
   print "$_\n";
}
print "calling func inside loop\n";
foreach ( @array ) {
   print "$_\n";
   func;
}
print "after calling func\n";
foreach ( @array ) {
   print "$_\n";
}

The ouput is:
before calling func
1
2
3
calling func inside loop
1
2
3
after calling func
100
100
100

What is the problem? I can not explain it. Why the function func
which using the stack can change my private @array? Ofcourse
if I use foreach $elem (@array), everything is OK.

That means if I designed the functions or objects method, the default
stack can't be used to avoid this kind of problem?

Thanks for your time and your help in advanced.
-- 
*************************************************************************
 Li  Peng (teilipe@tss.tei.ericsson.se)
 Ericsson Telecomunicazioni Italia S.p.A.
 Via Anagnina, 203 - 00040 - Roma - Italia

 Tel +39 6 72582911   Fax +39 6 72583127
*************************************************************************
Rule 46, Oxford Union Society, London:
	Any member introducing a dog into the Society's premises shall
	be liable to a fine of one pound.  Any animal leading a blind
	person shall be deemed to be a cat.


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

Date: 21 May 1998 12:13:44 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: strange behaviour of PERL
Message-Id: <895753275.248057@thrush.omix.com>

Peng Li <teilipe@tss.tei.ericsson.se> wrote:
: #!/usr/local/bin/perl
: sub func {
:    $_ = 100;
: }
	>snip<
: foreach ( @array ) {
:    print "$_\n";
:    func;
: }

: }
:
: What is the problem? I can not explain it. Why the function func
: which using the stack can change my private @array?

	Little known features of foreach.  The iteration variable used
	in the foreach is not a copy, but in fact an alias to the value,
	in this case $_.  Thus, when you change it you cange the value
	in the array.

: Ofcourse
: if I use foreach $elem (@array), everything is OK.

	You could still get the affect, if you called it like this:
	
	sub func { $_[0] = 100 }

	foreach $elem (@array) {
	    func ($elem);
	}

	This is because the @_ array passed to subs is a list of aliased
	values as well, so the current value of @array get's aliased to
	$elem, that gets aliased to $_[0] of func().  Simple, right? :-)

: That means if I designed the functions or objects method, the default
: stack can't be used to avoid this kind of problem?

	sub func {
	    local $_ = 100;
	}

	sub func {
	    my $foo = $_[0]; # copy it and $foo isn't an alias
	}

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: 21 May 1998 12:14:17 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: strange behaviour of PERL
Message-Id: <6k15qp$5nf$5@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Peng Li <teilipe@tss.tei.ericsson.se> writes:
:What is the problem? I can not explain it. Why the function func
:which using the stack can change my private @array? Ofcourse
:if I use foreach $elem (@array), everything is OK.

Because $_ is a global variable, and that global variable
an alias to your array.

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: Thu, 21 May 1998 08:16:14 -0400
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: What is wrong with this FileHandle code?
Message-Id: <35641B0E.74DD@gecm.com>

Tom Christiansen wrote:
> Yup, doc bug.  Method calls always need parens for their argument.
> But you really don't want to use the silly module anyway.  Why suck
> in 5,000 lines of code when the open function *works perfectly fine*,
> and about a zillion times faster, too.

I am writing a merge script to merge any number of files given
by command line (must be platform independent so a system utility
will not work):

File1:	File2:	File3:
-----------------------
1011	0011	1110
0001	1010	0000

Merged: 101100111110
        000110100000

Here is another problem:

E:\>type merge.pl
#!/usr/bin/perl -w
use FileHandle;
for ($i=0; $i<@ARGV; $i++) {
        $fh[$i] = new FileHandle;
        open($fh[$i],"$ARGV[$i]") || die("$!");
        print <$fh[$i]>;
}

E:\>perl merge.pl f1.txt f2.txt f3.txt
FileHandleFileHandleFileHandle

Is it not possible to create an array of file handles?

Cheers,

Jim
--


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

Date: 21 May 1998 12:28:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What is wrong with this FileHandle code?
Message-Id: <6k16m0$5nf$6@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    jim.michael@gecm.com writes:
:Is it not possible to create an array of file handles?

Sure it's possible to make it.  But it's just not useable in that fashion.
See my recent posting on indirect filehandle.

--tom
-- 
"If you substitute other kinds of intellectual property into the GNU
manifesto, it quickly becomes absurd." --Cal Keegan


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

Date: 21 May 1998 12:15:06 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Writing to files
Message-Id: <895753356.894782@thrush.omix.com>

Marcia L Sussman <pi83@dial.pipex.com> wrote:
: I have a program which opens a file for reading, closes it again, 
: then re-opens the file for writing and writes the information
: with additions. This should be easy, and it works 99% of the
: time.
: But occasionally the file becomes empty. Why???
: I'm locking the files whilst in use and closing them properly.
: Anyone else had this problem? Any ideas?

	Your code is what, exactly?  It's run under what conditions,
	exactly?

-- 
-Zenin
 zenin@archive.rhps.org


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

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

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