[31883] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3146 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 26 18:09:26 2010

Date: Sun, 26 Sep 2010 15:09:06 -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           Sun, 26 Sep 2010     Volume: 11 Number: 3146

Today's topics:
    Re: complex problem <tadmc@seesig.invalid>
    Re: complex problem <xhoster@gmail.com>
    Re: complex problem <xhoster@gmail.com>
    Re: Displaying 'umlaut' character <fbortel@home.nl>
    Re: Displaying 'umlaut' character <fbortel@home.nl>
    Re: toy list processing problem: collect similar terms <ben@morrow.me.uk>
    Re: toy list processing problem: collect similar terms <john@castleamber.com>
    Re: toy list processing problem: collect similar terms <xahlee@gmail.com>
    Re: why does this happen? <tadmc@seesig.invalid>
    Re: why does this happen? <tadmc@seesig.invalid>
    Re: why does this happen? <tadmc@seesig.invalid>
    Re: why does this happen? <hadronquark@gmail.com>
    Re: why does this happen? <mvdwege@mail.com>
    Re: why does this happen? <ben@morrow.me.uk>
    Re: why does this happen? <hjp-usenet2@hjp.at>
    Re: why does this happen? <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 26 Sep 2010 10:44:44 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: complex problem
Message-Id: <slrni9uqke.jub.tadmc@tadbox.sbcglobal.net>

ela <ela@yantai.org> wrote:

> Subject: complex problem


Please put the subject of your article in the Subject of your article.


-- 
Rest In Peace: 
Jonah McClellan gave his life for his country in a
helicopter crash in Afghanistan on September 21,2010.
Please pray for his wife and three children.


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

Date: Sun, 26 Sep 2010 11:32:48 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: complex problem
Message-Id: <4c9f9118$0$20871$ed362ca5@nr5-q3a.newsreader.com>

ela wrote:
> "Xho Jingleheimerschmidt" <xhoster@gmail.com> wrote in message 
> news:4c9ee57d$0$20963$ed362ca5@nr5-q3a.newsreader.com...
> 
>> Sorry, but it seems self-evident to me, so I don't see how I can explain 
>> it.  Maybe I'm not correctly apprehending what the purpose is that you 
>> have in mind.
>>
>> Xho
> 
> Let me give a simple example:
> 
> File 1
> ID character
> 1 A
> 2 T
> 3 G
> 
> File 2
> ID character
> 1 A
> 3 T
> 
> File 3
> ID character
> 2 A
> 3 T
> 4 C
> 
> processed result
> ID File 1 character File 2 character File 3 character
> 1               A                        A                n/a
> 2               T                       n/a                 A
> 3               G                        T                  T
> 4               n/a                     n/a                 C
> 

OK, so you have two hashes, one of them multi-level.

The multilevel one is $base{$id}{$file}=$nucleotide, so it contains all 
of the data.

The other one is just $file{$file}=(), so it tells you every file, i.e. 
every column that needs to exist in the output, so that you can reserve 
space for them all, even if a given $id doesn't have data for given $file.

Once you are done reading all the files, you'd probably want something like:

my @file=sort keys %file; # might want a non-default sort method.

to put that data into a more convenient format for using.

Then:
foreach my $id (keys %base) {
   my @output = @{$id{$base}}{@file};
   defined $_ or $_='n/a' foreach @output;
   print join ("\t", $id, @output), "\n";
};


I've changed the names of the hashes from the previous post, because you 
changed the nature of the data contained in them from your previous example.

Xho


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

Date: Sun, 26 Sep 2010 11:33:28 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: complex problem
Message-Id: <4c9f911a$0$20866$ed362ca5@nr5-q3a.newsreader.com>

Tad McClellan wrote:
> ela <ela@yantai.org> wrote:
> 
>> Subject: complex problem
> 
> 
> Please put the subject of your article in the Subject of your article.
> 

If he attempted to do that, he would be accused to committing the XYZ 
problem.

Xho


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

Date: Sun, 26 Sep 2010 17:26:11 +0200
From: Frank van Bortel <fbortel@home.nl>
Subject: Re: Displaying 'umlaut' character
Message-Id: <dae33$4c9f6614$524ba3af$22333@cache3.tilbu1.nb.home.nl>

On 09/22/2010 06:35 PM, joel garry wrote:
> On Sep 22, 12:20 am, Frank van Bortel<fbor...@home.nl>  wrote:
>> On 09/22/2010 06:50 AM, dn.p...@gmail.com wrote:
>>
>>
>>
>>> My aim is to display the ‘special’ (NON-Ascii) German character/
>>> diacritic umlaut or diaresis correctly on a browser. The browser calls
>>> a cgi perl-script which resides on a linux server. The browser which
>>> calls the perl-script displays Vietnamese characters correctly (but
>>> not the umlaut) without any special setting. The script sets NLS_LANG
>>> variable to AMERICAN_AMERICA.UTF8 and uses utf8 module, but that’s
>>> about it.
>>
>>> $ENV{'NLS_LANG'}='AMERICAN_AMERICA.UTF8';
>>>       Works for Vietnamese characters, but not with umlaut (ö).
>>
>>> But even before we get to a perl-script, perhaps the LC_CTYPE env
>>> variable needs to be set correctly. From my windows laptop, if I
>>> access Oracle through Oracle Query Server, I can see the umlaut. But
>>> if I open a linux-window, initiate an sqlplus session, and run the
>>> same SQL, I do not see the umlaut correctly. I have tried a few values
>>> for the env variable LC_CTYPE (like iso_8859_1, en_US,
>>> en_US.iso88591), but with no luck. The surprising thing is that
>>> ‘umalut’ is a muck-known alphabet, Vietnamese alphabets are less-
>>> known. Yet the Vietnamese characters are being displayed correctly.
>>
>>> What settings should I use in a perl-script or for a linux-window to
>>> see the umlaut correctly? Please advise.
>>
>> Maybe this helps: (shameless self promotion)http://vanbortel.blogspot.com/2009/04/special-characters-part-i.html
>> Last part is here:http://vanbortel.blogspot.com/2010/01/special-characters-part-iv.html
>
> Thanks for that Frank, I'm always forgetting where I've seen the
> excellent write-up.
>
> It always need to be emphasized that using the wrong database
> character set creates a ticking time bomb, as Oracle is so
> sophisticated about automatic conversions in various circumstances.
>
> jg
> --
> @home.com is bogus.
> http://www.fastcompany.com/1690122/bmw-touts-integration-with-ipads-blackberry-google

Thanks for the thumbs up.

However - one thing I was trying to clarify,
is the fact that
* you do not store characters; you store code points
* there's no such thing as a wrong database character set
(a.k.a. there's always one way to screw up, at least!)

-- 

Regards,

Frank van Bortel


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

Date: Sun, 26 Sep 2010 17:28:04 +0200
From: Frank van Bortel <fbortel@home.nl>
Subject: Re: Displaying 'umlaut' character
Message-Id: <517a2$4c9f6685$524ba3af$23268@cache3.tilbu1.nb.home.nl>

On 09/22/2010 03:29 PM, Peter J. Holzer wrote:
> On 2010-09-22 08:13, Frank van Bortel<fbortel@home.nl>  wrote:
>> Apart from what I replied earlier, the correct way to encode
>> is of course "&ouml;" (without the quotes...)
>
> That's not *the* correct way, just *a* correct way. Encoding it in the
> charset indicated in the Content-Type header or a meta tag is equally
> correct (and preferrable in most cicumstances, IMHO).
>
> 	hp
>

would you please read the HTML definition?

-- 

Regards,

Frank van Bortel


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

Date: Sun, 26 Sep 2010 16:39:56 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: toy list processing problem: collect similar terms
Message-Id: <c364n7-q8e1.ln1@osiris.mauzo.dyndns.org>


Quoth pjb@informatimago.com (Pascal J. Bourguignon):
> 
> It's too complex. Just write:
> 
> (let ((list '((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2 k l) (4 m n) 
>               (2 o p) (4 q r) (5 s t))))

Unless you're going to talk about Perl, please take clpmisc out of the
xpost.

Ben



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

Date: Sun, 26 Sep 2010 13:43:51 -0500
From: John Bokma <john@castleamber.com>
Subject: Re: toy list processing problem: collect similar terms
Message-Id: <87y6ao9wgo.fsf@castleamber.com>

Jürgen Exner <jurgenex@hotmail.com> writes:

> livibetter <livibetter@gmail.com> wrote:
>>Here is mine for Python:
>
> What the f*** does Python have to do with Perl?

Clueless fuck. I unsubscribed from comp.lang.perl.misc to avoid the
retards like you and now you come in via the backdoor. If you have a
problem with Xah report him with Google Groups and with his hosting
provider 1&1 like I do. Dreamhost kicked him out that way.

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/


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

Date: Sun, 26 Sep 2010 14:03:40 -0700 (PDT)
From: Xah Lee <xahlee@gmail.com>
Subject: Re: toy list processing problem: collect similar terms
Message-Id: <8055818b-a78d-4847-b39c-98c1edaa4b49@x20g2000pro.googlegroups.com>

On Sep 26, 7:56=C2=A0am, Sherm Pendley <sherm.pend...@gmail.com> wrote:
> J=C3=BCrgen Exner <jurge...@hotmail.com> writes:
> > Alexander Burger <a...@software-lab.de> wrote:
> >>In PicoLisp:
>
> > What the f**** does PicoLisp have to with Perl?
>
> It's Xah. He cross-posts in an attempt to start a language feud.
>
> Please don't feed the troll.

sorry i disagree. And please don't randomly accuse... I posted the
following in reply to Paul Rubin's very valuable post, to
comp.lang.python only. But since you cross-posted your accusation, and
there are about 3 other posts of similar nature accusing me cross-
posted to all groups, so am posting a response to all groups too.

--------------------------------------------------
Paul,

 ...

btw, i disagree about your remark on crossposting. For those
interested, you can read in the following:

=E2=80=A2 =E3=80=88Cross-posting &amp; Language Factions=E3=80=89
http://xahlee.org/Netiquette_dir/cross-post.html

if anyone wants to argue with me about this, there's a my blog link at
the bottom of the page where you can leave a comment. Feel free to use
that.

i'll go over the solutions and post if i have anything interesting to
say. =E2=98=BA Possbly will select some to show on my site with credit of
course.

 Xah =E2=88=91 xahlee.org =E2=98=84


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

Date: Sun, 26 Sep 2010 10:33:10 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: why does this happen?
Message-Id: <slrni9upun.jub.tadmc@tadbox.sbcglobal.net>

["Followup-To:" header set to comp.lang.perl.misc.]

Uno <merrilljensen@q.com> wrote:

> Subject: why does this happen?


Please put the subject of your article in the Subject of your article.


-- 
Rest In Peace: 
Jonah McClellan gave his life for his country in a
helicopter crash in Afghanistan on September 21,2010.
Please pray for his wife and three children.


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

Date: Sun, 26 Sep 2010 10:34:15 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: why does this happen?
Message-Id: <slrni9uq0o.jub.tadmc@tadbox.sbcglobal.net>

["Followup-To:" header set to comp.lang.perl.misc.]

Jürgen Exner <jurgenex@hotmail.com> wrote:
> Uno <merrilljensen@q.com> wrote:

>>Na, Jens, why the heck does my OS change permissions when I rename a file?
>
> You may want to ask in NG that deals with whatever OS you are using (you
> didn't even say!).


The Newsgroups header does...


-- 
Rest In Peace: 
Jonah McClellan gave his life for his country in a
helicopter crash in Afghanistan on September 21,2010.
Please pray for his wife and three children.


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

Date: Sun, 26 Sep 2010 10:41:54 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: why does this happen?
Message-Id: <slrni9uqf3.jub.tadmc@tadbox.sbcglobal.net>

["Followup-To:" header set to comp.lang.perl.misc.]

Jürgen Exner <jurgenex@hotmail.com> wrote:
> Uno <merrilljensen@q.com> wrote:

>>Nuts, jue, I have every belief that it wasn't perl.  


Then you should not have posted it to a Perl newsgroup!


>> Maybe you can help 
>>me with this while the other subthread considers the part that is 
>>germane to perl.


There is no part that is germane to Perl (nor to perl).


>>So I rename rm1.f90 to rm2.f90, and I have no problem on the command 
>>line except to iterate the integer that postpends the source file.
>
> What do you mean by "iterate the integer that postpends the source
> file"? And what's a f90 file?


I expect that he did something like:

    rename 1 2 rm1.f90

Though he never said what he did, which is pretty silly, as what
he did is germane to what ended up happening...


-- 
Rest In Peace: 
Jonah McClellan gave his life for his country in a
helicopter crash in Afghanistan on September 21,2010.
Please pray for his wife and three children.


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

Date: Sun, 26 Sep 2010 17:52:01 +0200
From: Hadron<hadronquark@gmail.com>
Subject: Re: why does this happen?
Message-Id: <i7nq73$4kn$1@news.eternal-september.org>

Tad McClellan <tadmc@seesig.invalid> writes:

> ["Followup-To:" header set to comp.lang.perl.misc.]
>
> Jürgen Exner <jurgenex@hotmail.com> wrote:
>> Uno <merrilljensen@q.com> wrote:
>
>>>Nuts, jue, I have every belief that it wasn't perl.  
>
> Then you should not have posted it to a Perl newsgroup!
>
>>> Maybe you can help 
>>>me with this while the other subthread considers the part that is 
>>>germane to perl.
>
> There is no part that is germane to Perl (nor to perl).
>
>>>So I rename rm1.f90 to rm2.f90, and I have no problem on the command 
>>>line except to iterate the integer that postpends the source file.
>>
>> What do you mean by "iterate the integer that postpends the source
>> file"? And what's a f90 file?
>
> I expect that he did something like:
>
>     rename 1 2 rm1.f90
>
> Though he never said what he did, which is pretty silly, as what
> he did is germane to what ended up happening...

So 

"So I rename rm1.f90 to rm2.f90,"

Doesn't mean anything to you either?

Hmmm. Maybe I'm totally wrong since thats now 2 people not reading what
he said with apparently any desire to help or understand his issue
whatsoever. Which would be very strange for "help" groups after all.




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

Date: Sun, 26 Sep 2010 21:07:31 +0200
From: Mart van de Wege <mvdwege@mail.com>
Subject: Re: why does this happen?
Message-Id: <86hbhcpbm4.fsf@gareth.avalon.lan>

Hadron<hadronquark@gmail.com> writes:

> Mart van de Wege <mvdwege@mail.com> writes:
>
>> Hadron<hadronquark@gmail.com> writes:
>>
>>>
>>> As a side note regarding perl if he's a complete beginner which seems
>>> likely it might be worth suggesting he doesnt put his scripts on the
>>> path and he doesn't set them for exec 
>>
>> As usual, you are talking bollocks.
>>
>> He's using syntax that indicates he is *NOT* executing his scripts from
>> his $PATH. And as long as you do not explicitly do what every Linux
>> distribution has prevented you from doing, setting a script in your
>> current directory to executable is no problem at all.
>
> I suggested that its not on the path IN CASE : hence I mentioned
> SPECIFICALLY running perl. At no point did I say they are currently on
> the path either.
>
Actually, you did. Otherwise your suggestion that he shouldn't put his
scripts in his $PATH wouldn't make any sense.

Then again, you seldom make any sense anyway.

> My POINT was that you DONT NEED exec permissions when developing when
> you specifically invoke perl.
>
Then you shouldn't have said so. Instead you strongly suggested that
it's not a matter of *need*, but a matter of *don't*. Which, as I
explained, is unnecessary in this case, as the OP is obviously aware how
to execute a file in his cwd.
>
> That is VERY common during development : I dont expect you to understand.
>
I suspect I write more perl during a working day than you have done in
your entire life.

> You're a moron.

Coming from you, that's a compliment.

Sorry to the clpm guys, but Hadron is a known troll in aolu and advocacy
groups (not that advocacy needs more trolls, but he alone can make up
half the traffic in one).

I've set follow-ups to aolu.

Mart

-- 
"We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.


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

Date: Sun, 26 Sep 2010 22:16:13 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: why does this happen?
Message-Id: <tpp4n7-ctf1.ln1@osiris.mauzo.dyndns.org>


Quoth Hadron<hadronquark@gmail.com>:
> 
> So 
> 
> "So I rename rm1.f90 to rm2.f90,"
> 
> Doesn't mean anything to you either?

*How* *exactly* did you do that? I don't know of any obvious way of
renaming a file under Unix which will strip the execute bit, so you must
have done it a non-obvious way.

Ben



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

Date: Sun, 26 Sep 2010 23:24:12 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: why does this happen?
Message-Id: <slrni9vefu.efs.hjp-usenet2@hrunkner.hjp.at>

On 2010-09-26 15:52, Hadron <hadronquark@gmail.com> wrote:
> Tad McClellan <tadmc@seesig.invalid> writes:
>> Jürgen Exner <jurgenex@hotmail.com> wrote:
>>> Uno <merrilljensen@q.com> wrote:
>>>>So I rename rm1.f90 to rm2.f90, and I have no problem on the command 
>>>>line except to iterate the integer that postpends the source file.
>>>
>>> What do you mean by "iterate the integer that postpends the source
>>> file"? And what's a f90 file?
>>
>> I expect that he did something like:
>>
>>     rename 1 2 rm1.f90
>>
>> Though he never said what he did, which is pretty silly, as what
>> he did is germane to what ended up happening...
>
> "So I rename rm1.f90 to rm2.f90,"
>
> Doesn't mean anything to you either?

That would normally mean that he invoked 

    mv rm1.f90 rm2.f90

But that doesn't have to claimed effect of changing the permissions, so
I doubt he did that.

"rename" is not a standard POSIX command. My system has a rename
command, but it apparently has a different syntax than Tad's rename
command:

    rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]

And the OP might also have used a graphical shell or some other tool. 

No use guessing. Several people have now asked the OP how he "renamed"
the file, and we should just wait for his answer.

	hp



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

Date: Sun, 26 Sep 2010 23:27:01 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: why does this happen?
Message-Id: <slrni9vel7.efs.hjp-usenet2@hrunkner.hjp.at>

On 2010-09-26 14:10, Jürgen Exner <jurgenex@hotmail.com> wrote:
> Uno <merrilljensen@q.com> wrote:
>>Why is perl different?
>
> perl doesn't even come into the game yet. This error message "bash:
> ./perl2.pl: Permission denied" is thrown by bash _BEFORE_ bash even
> attempts to call the perl interpreter.
> It's a feature of your shell: you cannot execute a program unless you
> have execute permissions for that program. And this is the same for any
> executable file, no matter what programming language it is written in.

Nope. It's a feature of the OS kernel, not the shell. At least on unixes
younger than about 20 years or so.

	hp



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

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:

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

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 3146
***************************************


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