[26369] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8541 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 19 06:05:56 2005

Date: Wed, 19 Oct 2005 03:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 19 Oct 2005     Volume: 10 Number: 8541

Today's topics:
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
    Re: FAQ 4.69 How can I use a reference as a hash key? (Anno Siegel)
    Re: Microsoft Hatred FAQ <my_email_is_posted_on_my_website@munged.invalid>
    Re: Microsoft Hatred FAQ <my_email_is_posted_on_my_website@munged.invalid>
    Re: Microsoft Hatred FAQ <davids@webmaster.com>
    Re: Microsoft Hatred FAQ <davids@webmaster.com>
    Re: Microsoft Hatred FAQ <luke@webber.com.au>
    Re: Microsoft Hatred FAQ <my_email_is_posted_on_my_website@munged.invalid>
    Re: Microsoft Hatred FAQ <my_email_is_posted_on_my_website@munged.invalid>
    Re: Microsoft Hatred FAQ <davids@webmaster.com>
    Re: Microsoft Hatred FAQ <davids@webmaster.com>
    Re: Microsoft Hatred FAQ <apardon@forel.vub.ac.be>
    Re: where is my text file? <tintin@invalid.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Oct 2005 04:39:04 GMT
From: <jari.aalto <AT> poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1129696518@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto A T poboxes com

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs/XEmacs

        o   Unix:
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/

        o   Unix Windows port (for Unix die-hards):
            install http://www.cygwin.com/  which includes native Emacs 21.x.
            and XEmacs port

        o   Pure Native Windows port
            http://www.gnu.org/software/emacs/windows/ntemacs.html
            ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe

        o   More Emacs resources at
            http://tiny-tools.sourceforge.net/  => Emacs resource page

Emacs Perl Modules

    Cperl -- Perl programming mode

        http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
        http://math.berkeley.edu/~ilya/software/emacs/
        by Ilya Zakharevich

        CPerl is major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        standard in newest Emacs.

    TinyPerl -- Perl related utilities

        http://tiny-tools.sourceforge.net/

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Grep through all Perl manpages (.pod)
        o   Follow POD references e.g. [perlre] to next pod with RETURN
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.

        o   Update `$VERSION' variable with YYYY.MMDD on save.
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Prepare script (version numbering) and Upload it to PAUSE
        o   Generate autoload STUBS (Devel::SelfStubber) for you
            Perl Module (.pm)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in Tiny Tools Kit]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
        how to set up dattabases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to to do the search, You can adjust
        recursive grep options, set search case sensitivity, add user grep
        options etc.

        You can find latest `igrep.el' module at
        <http://groups.google.com/groups?group=gnu.emacs.sources> The
        maintainer is Jefin Rodgers <kevinr <AT> ihs.com>.

    TinyCompile -- To Browse grep results in Emacs *compile* buffer

        TinyCompile is a minor mode for *compile* buffer from where
        you can collapse unwanted lines or shorten file URLs:

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->

            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



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

Date: 19 Oct 2005 07:31:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: FAQ 4.69 How can I use a reference as a hash key?
Message-Id: <dj4so7$iti$1@mamenchi.zrz.TU-Berlin.DE>

Jim Gibson  <jgibson@mail.arc.nasa.gov> wrote in comp.lang.perl.misc:
> In article <dj2e5t$49t$1@mamenchi.zrz.TU-Berlin.DE>, Anno Siegel
> <anno4000@lublin.zrz.tu-berlin.de> wrote:
> 
> > Jim Gibson  <jgibson@mail.arc.nasa.gov> wrote in comp.lang.perl.misc:
> > > In article <091020051535518794%comdog@panix.com>, brian d foy
> > > <comdog@panix.com> wrote:
> > > 
> > > > In article <190920051034314514%jgibson@mail.arc.nasa.gov>, Jim Gibson
> > > > <jgibson@mail.arc.nasa.gov> wrote:
> > > > 
> > > > > In article <dgm2cl$cgt$1@reader1.panix.com>, PerlFAQ Server
> > > > > <comdog@panix.com> wrote:
> > > > > 
> > > > > > This message is one of several periodic postings to
> > > > > > comp.lang.perl.misc
> > > > > > intended to make it easier for perl programmers to find answers to
> > > > > > common questions. The core of this message represents an excerpt
> > > > > > from the documentation provided with Perl.
> > > > > > 
> > > > > > --------------------------------------------------------------------
> > > > > > 
> > > > > > 4.69: How can I use a reference as a hash key?
> > > > > > 
> > > > > >     You can't do this directly, but you could use the standard
> > > > > >     Tie::RefHash
> > > > > >     module distributed with Perl.
> > > > > 
> > > > > This answer seems incomplete and therefore misleading. You can use hard
> > > > > references as hash keys, because they become stringified and are
> > > > > unique. 
> > 
> > A hash key is a string, a reference is not.  You can't use a reference
> > as a hash key.
> 
> A binary number isn't a string, either, but must be stringified before
> being used as a hash key.

Quite.  Numbers can't be hash keys either.

> What's the difference, other than the fact
> that you can retrieve the number string from the hash and convert it
> back to a number, but you can't retrieve the reference string and
          ^
That's *a* number, not necessarily *the* number.

    my $x = 1.00000_00000_00000_9;
    my %h = ( $x => 'boing');
    my ( $y) = keys %h;
    die unless $x == $y;

That dies because stringification doesn't preserve full accuracy.  If the
actual number could be used as a hash key this wouldn't happen.

> convert it back to a reference?
>
> > You can use a reference to generate a hash key, but that's not the same
> > thing.
> 
> But you can use the reference in a hash as a hash key. That's the point.
> 
> > > I would think the FAQ would better serve its readers if it explained
> > > how they might use references as hash keys and what the limitations
> > > are, rather than simply stating an untruth.
> > 
> > The FAQ is terse but correct.
> > 
> > Anno
> 
> How can the FAQ be correct when I can do this:
> 
> Jim 51% cat refkey.pl
> #!/usr/local/bin/perl
> use strict;
> use warnings;
> 
> my $x = 'value of x';
> my $rx = \$x;
> my %hash;
> $hash{$rx} = $x;
> print "\$hash{\$rx} = '$hash{$rx}'\n";
> print keys %hash, "\n";
> 
> Jim 52% perl refkey.pl
> $hash{$rx} = 'value of x'
> SCALAR(0x180a024)
> 
> 
> Is this not "using a reference as a hash key directly"?

Only loosely speaking.  Strictly, we use references, or numbers, to generate
hash keys, but the hash keys are neither references nor numbers.  They lose
essential properties in the process.

Anno
-- 
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article.  Click on 
"show options" at the top of the article, then click on the 
"Reply" at the bottom of the article headers.


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

Date: Wed, 19 Oct 2005 04:34:28 GMT
From: Roedy Green <my_email_is_posted_on_my_website@munged.invalid>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <35jbl1dprs4v1o87i0tapc2husjqiqm6fi@4ax.com>

On Tue, 18 Oct 2005 20:30:42 -0700, "David Schwartz"
<davids@webmaster.com> wrote or quoted :

>
>    No, taken stupidly. Hint: would or would not MS executives disobeying 
>the law constitute a betrayal of their obligation to their shareholders?

You stated it literally as if making maximum profit for the
shareholders were the only consideration in determining conduct.

If that is not what you mean, I think you need to hedge more.
-- 
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.


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

Date: Wed, 19 Oct 2005 04:36:32 GMT
From: Roedy Green <my_email_is_posted_on_my_website@munged.invalid>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <48jbl1honbc8ccfnkuo0bjatmqi5bqfks4@4ax.com>


On Tue, 18 Oct 2005 20:34:55 -0700, "David Schwartz"
<davids@webmaster.com> wrote or quoted :

> As for obligations to community, no, there is no such obligation. An 
>executive who devoted his company to his community against his shareholders' 
>wishes should be fired. The company exists as a vehicle to execute the 
>desires of the shareholders. That's why they get to vote on who runs it.

Why should loyalty to company trump all other loyalties -- family,
law, species,  community, country, religion ... ?
-- 
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.


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

Date: Tue, 18 Oct 2005 23:16:32 -0700
From: "David Schwartz" <davids@webmaster.com>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <dj4oc0$tct$1@nntp.webmaster.com>


"Roedy Green" <my_email_is_posted_on_my_website@munged.invalid> wrote in 
message news:35jbl1dprs4v1o87i0tapc2husjqiqm6fi@4ax.com...

> On Tue, 18 Oct 2005 20:30:42 -0700, "David Schwartz"
> <davids@webmaster.com> wrote or quoted :

>>    No, taken stupidly. Hint: would or would not MS executives disobeying
>>the law constitute a betrayal of their obligation to their shareholders?

> You stated it literally as if making maximum profit for the
> shareholders were the only consideration in determining conduct.

    No, I did not. I said that their obligation is to their shareholders.

> If that is not what you mean, I think you need to hedge more.

    I was perfectly clear. This is a lot of deliberate misunderstanding 
going on in this thread and very little of it is from my side.

    DS




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

Date: Tue, 18 Oct 2005 23:18:31 -0700
From: "David Schwartz" <davids@webmaster.com>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <dj4ofo$tcu$1@nntp.webmaster.com>


"Roedy Green" <my_email_is_posted_on_my_website@munged.invalid> wrote in 
message news:48jbl1honbc8ccfnkuo0bjatmqi5bqfks4@4ax.com...

> On Tue, 18 Oct 2005 20:34:55 -0700, "David Schwartz"
> <davids@webmaster.com> wrote or quoted :

>> As for obligations to community, no, there is no such obligation. An
>>executive who devoted his company to his community against his 
>>shareholders'
>>wishes should be fired. The company exists as a vehicle to execute the
>>desires of the shareholders. That's why they get to vote on who runs it.

> Why should loyalty to company trump all other loyalties -- family,
> law, species,  community, country, religion ... ?

    Perhaps you aren't following the thread, but I was talking about the 
obligations a company has, not the obligations any individual has. And I was 
talking about obligations *to* individuals.

    Your criticism would be very appropriate if I said that individuals only 
owe loyalty to companies. But what I said is that Microsoft (a company) owes 
an obligation to its shareholders (people). That is, that companies exist 
purely to benefit people.

    It is funny that your accusation is based on assuming I said exactly the 
opposite of what I actually said.

    DS




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

Date: Wed, 19 Oct 2005 16:40:50 +1000
From: Luke Webber <luke@webber.com.au>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <4355ea72$1_3@news.melbourne.pipenetworks.com>

David Schwartz wrote:
> "Roedy Green" <my_email_is_posted_on_my_website@munged.invalid> wrote in 
> message news:35jbl1dprs4v1o87i0tapc2husjqiqm6fi@4ax.com...
>>On Tue, 18 Oct 2005 20:30:42 -0700, "David Schwartz"
>><davids@webmaster.com> wrote or quoted :
> 
>>>   No, taken stupidly. Hint: would or would not MS executives disobeying
>>>the law constitute a betrayal of their obligation to their shareholders?
> 
>>You stated it literally as if making maximum profit for the
>>shareholders were the only consideration in determining conduct.
> 
>     No, I did not. I said that their obligation is to their shareholders.

As much as I hate to jump in on this thread, well I'm gonna...

I think you'll find that companies have all manner of legal obligations. 
Certainly to their shareholders, but beyond that they have an obligation 
  to their clients, who pay them for their services, and to any 
individual or entity which might be harmed by their actions.

A classic case in point would be Philip Morris, who did everything they 
could to protect their shareholders, but who shirked their duty of care 
to their customers and the the public at large. They have since paid 
heavily for that failure.

>>If that is not what you mean, I think you need to hedge more.
> 
>     I was perfectly clear. This is a lot of deliberate misunderstanding 
> going on in this thread and very little of it is from my side.

All that means to me is that your misunderstanding is not deliberate. <g>

Luke


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

Date: Wed, 19 Oct 2005 08:42:03 GMT
From: Roedy Green <my_email_is_posted_on_my_website@munged.invalid>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <8l1cl1plroff0mt8asqk1j8pocaf7kormo@4ax.com>

On Tue, 18 Oct 2005 23:16:32 -0700, "David Schwartz"
<davids@webmaster.com> wrote or quoted :

>    No, I did not. I said that their obligation is to their shareholders.
>
>> If that is not what you mean, I think you need to hedge more.
>
>    I was perfectly clear. This is a lot of deliberate misunderstanding 
>going on in this thread and very little of it is from my side.
>

You have a problem because there are many other people saying similar
things to you who mean something much more extreme. If you don't
intend that, you need to be more precise in your language.
-- 
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.


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

Date: Wed, 19 Oct 2005 08:45:45 GMT
From: Roedy Green <my_email_is_posted_on_my_website@munged.invalid>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <io1cl1tv54gs7epehprk566spfs2bln3if@4ax.com>

On Tue, 18 Oct 2005 23:18:31 -0700, "David Schwartz"
<davids@webmaster.com> wrote or quoted :

>    Perhaps you aren't following the thread, but I was talking about the 
>obligations a company has, not the obligations any individual has. And I was 
>talking about obligations *to* individuals.

To me that makes no sense. Microsoft is an abstraction. It can't do
anything. It can't make decisions. Only the individuals to work for it
or on the board can, though they may do it in Microsoft's name.  If
you want to talk about moral action, obligation etc. you can't divorce
that from the people who do the actions.

-- 
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.


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

Date: Wed, 19 Oct 2005 01:54:14 -0700
From: "David Schwartz" <davids@webmaster.com>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <dj51jn$13p$1@nntp.webmaster.com>


"Luke Webber" <luke@webber.com.au> wrote in message 
news:4355ea72$1_3@news.melbourne.pipenetworks.com...

> As much as I hate to jump in on this thread, well I'm gonna...

> I think you'll find that companies have all manner of legal obligations. 
> Certainly to their shareholders, but beyond that they have an obligation 
> to their clients, who pay them for their services, and to any individual 
> or entity which might be harmed by their actions.

    They have obligations to their clients because (and only because) 
failure to provide the services they contract to provide will result in 
lawsuits and harm to the shareholders. All other obligations come from the 
harm these failures will do to the shareholders. First and formost, 
companies exist to do the will of their shareholders.

> A classic case in point would be Philip Morris, who did everything they 
> could to protect their shareholders, but who shirked their duty of care to 
> their customers and the the public at large. They have since paid heavily 
> for that failure.

    You mean their shareholders paid heavily. ;)

>>>If that is not what you mean, I think you need to hedge more.

>>     I was perfectly clear. This is a lot of deliberate misunderstanding 
>> going on in this thread and very little of it is from my side.

> All that means to me is that your misunderstanding is not deliberate. <g>

    No misunderstanding. Corporations exist specifically to do the will of 
their shareholders. There are other theoritcal models of corporations (for 
example, wherein the shareholders only provide the capital to execute the 
will of the directors), but Microsoft is certainly not a corporation of this 
type.

    DS




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

Date: Wed, 19 Oct 2005 01:57:32 -0700
From: "David Schwartz" <davids@webmaster.com>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <dj51pt$13q$1@nntp.webmaster.com>


"Roedy Green" <my_email_is_posted_on_my_website@munged.invalid> wrote in 
message news:io1cl1tv54gs7epehprk566spfs2bln3if@4ax.com...

> On Tue, 18 Oct 2005 23:18:31 -0700, "David Schwartz"
> <davids@webmaster.com> wrote or quoted :

>>    Perhaps you aren't following the thread, but I was talking about the
>>obligations a company has, not the obligations any individual has. And I 
>>was
>>talking about obligations *to* individuals.

> To me that makes no sense. Microsoft is an abstraction. It can't do
> anything. It can't make decisions. Only the individuals to work for it
> or on the board can, though they may do it in Microsoft's name.  If
> you want to talk about moral action, obligation etc. you can't divorce
> that from the people who do the actions.

    If anything that makes the objection even less meaningful. The objection 
was:

> Why should loyalty to company trump all other loyalties -- family,
> law, species,  community, country, religion ... ?

    And the answer is that I'm not talking about "loyalty to company" but 
loyalty to shareholders, which are people. Of course, a person is never 
required to do anything that actually conflicts with their conscience, 
although in some cases this may require you to quit.

    DS




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

Date: 19 Oct 2005 09:41:09 GMT
From: Antoon Pardon <apardon@forel.vub.ac.be>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <slrndlc55k.9v5.apardon@rcpc42.vub.ac.be>

Op 2005-10-19, David Schwartz schreef <davids@webmaster.com>:
>
> "Luke Webber" <luke@webber.com.au> wrote in message 
> news:4355ea72$1_3@news.melbourne.pipenetworks.com...
>
>> As much as I hate to jump in on this thread, well I'm gonna...
>
>> I think you'll find that companies have all manner of legal obligations. 
>> Certainly to their shareholders, but beyond that they have an obligation 
>> to their clients, who pay them for their services, and to any individual 
>> or entity which might be harmed by their actions.
>
>     They have obligations to their clients because (and only because) 
> failure to provide the services they contract to provide will result in 
> lawsuits and harm to the shareholders. All other obligations come from the 
> harm these failures will do to the shareholders. First and formost, 
> companies exist to do the will of their shareholders.

Do I understand correctly.

Lets take the following situation:

A company figures out something is wrong with one of their new models.
They have two options. They can repair the problem or they can leave
it as is and brace the laswsuits that will likely follow. An analysis
shows that the first option is likely to cost more than the second.

As far as I understand you, the company should ship the faulty model.

-- 
Antoon Pardon


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

Date: Wed, 19 Oct 2005 21:14:16 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: where is my text file?
Message-Id: <rfn5f.1402$S24.90630@news.xtra.co.nz>


"code_wrong" <tac@tac.ouch.co.uk> wrote in message 
news:43551b5c$1_3@mk-nntp-2.news.uk.tiscali.com...
> hi,
> I using the following script (from CGI and Perl in easy steps book) as a 
> hit counter:

Throw that book away.  The code example is simply woeful.  You will be 
learning many, many bad habits if you follow the book.

[horrible code snipped] 




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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.

#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 V10 Issue 8541
***************************************


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