[31260] in Perl-Users-Digest
Perl-Users Digest, Issue: 2505 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 6 18:09:45 2009
Date: Mon, 6 Jul 2009 15:09:15 -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 Mon, 6 Jul 2009 Volume: 11 Number: 2505
Today's topics:
Re: formatting a number of elsif statements <m@rtij.nl.invlalid>
Re: formatting a number of elsif statements sln@netherlands.com
Re: formatting a number of elsif statements <cartercc@gmail.com>
Re: formatting a number of elsif statements sln@netherlands.com
HTTP::Cookies bug <russgoog@gmail.com>
Notationsfrage <cyrus.kriticos@googlemail.com>
Re: Notationsfrage sln@netherlands.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 6 Jul 2009 22:27:27 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: formatting a number of elsif statements
Message-Id: <fa3ai6-fgt.ln1@news.rtij.nl>
On Mon, 06 Jul 2009 12:55:43 -0700, sln wrote:
> Lets get at least a little bit real. Case/Switch was added to C for only
> one reason, as a pass through when conditions overlapp. It still uses
> the basic assembly branches but it is still a compound.
Another reason is that it can often be implemented using a branch table.
>
> Looks are in the eye of the beholder. You obviously never programmed in
> assembly.
>
And obviously, you didn't look enough at disassembled C. :-)
M4
------------------------------
Date: Mon, 06 Jul 2009 13:32:51 -0700
From: sln@netherlands.com
Subject: Re: formatting a number of elsif statements
Message-Id: <dmn4555mj65cmp0isic1p41pevducki5ie@4ax.com>
On Mon, 6 Jul 2009 22:27:27 +0200, Martijn Lievaart <m@rtij.nl.invlalid> wrote:
>On Mon, 06 Jul 2009 12:55:43 -0700, sln wrote:
>
>> Lets get at least a little bit real. Case/Switch was added to C for only
>> one reason, as a pass through when conditions overlapp. It still uses
>> the basic assembly branches but it is still a compound.
>
>Another reason is that it can often be implemented using a branch table.
>
[snip]
>
>M4
I'm sorry, I missed that branch table instruction in the op code list (rst?).
Perhaps you should dissasemble your assembler.
-sln
------------------------------
Date: Mon, 6 Jul 2009 14:03:06 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: formatting a number of elsif statements
Message-Id: <f68dfd2d-04fe-40e8-b487-ab25db7a4c2c@g19g2000yql.googlegroups.com>
On Jul 6, 3:55=A0pm, s...@netherlands.com wrote:
> I haven't read any other reply's but I would bet there is that
> switch/case mimic in Perl 5.10
Yes.
> Forgetting languages except assembly for the moment. How many branch
> instructions do you think there are, and how many language intrinsics
> do you think you can make with them?
As you say, looks are in the eye of the beholder. In this case, you
can see the logic in two ways. The first way is how I started out, by
switching based on the type (Agent, Attorney, Employer, etc) and task
(insert, update, delete, select). The second way is how I ended up, in
a more OO style, trashing all the branches and replacing them with a
generic function, like this:
$hashref =3D do_it($type, $task);
> Lets get at least a little bit real. Case/Switch was added to C for only =
one
> reason, as a pass through when conditions overlapp. It still uses the bas=
ic
> assembly branches but it is still a compound.
I don't know about that. I had six months of assembly years ago and
can't remember much about it.
> Looks are in the eye of the beholder. You obviously never programmed in a=
ssembly.
Yes, and yes.
CC
------------------------------
Date: Mon, 06 Jul 2009 14:27:17 -0700
From: sln@netherlands.com
Subject: Re: formatting a number of elsif statements
Message-Id: <7hq45552b23p62r6pt6thansajk3u8uq6j@4ax.com>
On Mon, 6 Jul 2009 14:03:06 -0700 (PDT), ccc31807 <cartercc@gmail.com> wrote:
>On Jul 6, 3:55 pm, s...@netherlands.com wrote:
<snip>
>> Lets get at least a little bit real. Case/Switch was added to C for only one
>> reason, as a pass through when conditions overlapp. It still uses the basic
>> assembly branches but it is still a compound.
>
>I don't know about that. I had six months of assembly years ago and
>can't remember much about it.
>
>> Looks are in the eye of the beholder. You obviously never programmed in assembly.
>
>Yes, and yes.
>
>CC
I started out doing assembly on the z80a actually, before assemblers. Did alot of
hand written code (to be machine input later), later looked at all the 8080/286/386/486,
and assemblers (Intel mostly), then reviewed the Motorolla, then some other cpu's, which
were almost identical in basic functionality.
There is only jump relative and its conditional flavors, or jump absolute, and restart (rst)
which is a table absolute jump commonly used to boot (absolute code) systems or in response
to intterrupts (hardware reset), not used by languages.
So there you have it, jump relative (with conditional) or jump absolute.
Remember any of that?
-sln
------------------------------
Date: Mon, 6 Jul 2009 15:08:35 -0700 (PDT)
From: Russ in San Diego <russgoog@gmail.com>
Subject: HTTP::Cookies bug
Message-Id: <cad53ce1-8d37-4dc9-8691-0b83e71a27a8@o9g2000prg.googlegroups.com>
Does anyone know whether someone is maintaining HTTP::Cookies? I'm
pretty sure I've found a bug, and have a tentative fix for it. I
tried emailing the person who is listed as the maintainer (Gisle Aas)
at his ActiveState.com email address, but I never received a
response.
------------------------------
Date: Mon, 06 Jul 2009 22:54:38 +0200
From: Cyrus Kriticos <cyrus.kriticos@googlemail.com>
Subject: Notationsfrage
Message-Id: <7bf6keF238vsfU1@mid.individual.net>
Hallo,
was verbirgt sich hinter der Notation bzw. wofür sind die geschweiften
Klammern?
$f = { 'e' => $e };
Mein kleines Beispielprogramm das $f mit Dumper ausgibt (aus der
Dumper-manpage):
--- cut here ---
#!/usr/bin/perl
use Data::Dumper;
$Data::Dumper::Maxdepth = 3;
$a = "pearl";
$b = [ $a ];
$c = { 'b' => $b };
$d = [ $c ];
$e = { 'd' => $d };
$f = { 'e' => $e };
print Dumper($f);
--- cut here ---
Die Ausgabe sieht wie folgt aus:
$VAR1 = {
'e' => {
'd' => [
'HASH(0x90bc2c8)'
]
}
};
Meine Frage ist, die komme ich an e und die könnte man, wenn sich auf der
Ebene von e mehrere Elemente befinden, deren Namen rausbekommen? Eine
mögliche Ausgabe wäre z.B.:
$VAR1 = {
'e' => {
'd' => [
'HASH(0x90bc2c8)'
]
}
'g' => {
'd' => [
'HASH(0x90bc2d8)'
]
}
'h' => {
'd' => [
'HASH(0x90bc2e8)'
]
}
};
Wie kriege ich raus, dass sich in in f e, g und h befinden?
Danke für Feedback.
--
Grüße | Estimator: "Gommste von driebn?"
Cyrus | Tapio: "Gänse fleisch mal den Kofferraum oof moch'n?"
| Quelle: Forum des Heise-Newstickers
------------------------------
Date: Mon, 06 Jul 2009 14:50:15 -0700
From: sln@netherlands.com
Subject: Re: Notationsfrage
Message-Id: <lbs455dckgg8jtgfpvval8stjgftrm7lr2@4ax.com>
On Mon, 06 Jul 2009 22:54:38 +0200, Cyrus Kriticos <cyrus.kriticos@googlemail.com> wrote:
>Hallo,
>
>was verbirgt sich hinter der Notation bzw. wofür sind die geschweiften
>Klammern?
>
>$f = { 'e' => $e };
>
>
>Mein kleines Beispielprogramm das $f mit Dumper ausgibt (aus der
>Dumper-manpage):
>
>--- cut here ---
>#!/usr/bin/perl
>
>use Data::Dumper;
>$Data::Dumper::Maxdepth = 3;
>
$Data::Dumper::Purity = 1;
>
-sln
------------------------------
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 V11 Issue 2505
***************************************