From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: [devel] Re: I: rpm-build-perl-0.5
Date: Wed, 8 Dec 2004 09:53:27 +0300
Message-ID: <20041208065327.GI30266@solemn.turbinal.org> (raw)
In-Reply-To: <20041208061207.GH30266@solemn.turbinal.org>
[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]
On Wed, Dec 08, 2004 at 09:12:07AM +0300, Alexey Tourbin wrote:
> On Wed, Dec 08, 2004 at 08:12:12AM +0300, Alexey I. Froloff wrote:
> > Кстати, а такая проблема в новом r-b-p решена?
> >
> > use constant MP2 => $mod_perl::VERSION >= 1.99;
> >
> > BEGIN {
> > my @constants = qw( OK AUTH_REQUIRED FORBIDDEN DECLINED SERVER_ERROR );
> > if (MP2) {
> > require Apache::Const;
> > import Apache::Const @constants;
> > }
> > else {
> > require Apache::Constants;
> > import Apache::Constants @constants;
> > }
> > }
> >
> > После чего в Requires попадают и Apache::Const и
> > Apache::Constants. Это perl-Apache-DBI 0.94, собирал сам для
> > 2.2.
>
> Думаю, что решена, т.к. константные функции с пустым прототипом
> подставляются на стадии компиляции (perlsub/Constant Functions), а потом
> по дереву проходится оптимизатор (perlguts/constant folding).
>
> $ perl -MO=Concise,-terse -e 'sub true(){1} if(true){require "asdf"} else{require "zxcv"}'
> LISTOP (0x80662c0) leave [1]
> OP (0x804fc88) enter
> COP (0x80661e0) nextstate
> LISTOP (0x8066420) scope
> OP (0x804fce0) null [174]
> UNOP (0x80663c8) require
> SVOP (0x80662f8) const [1] PV (0x80643f0) "asdf"
> -e syntax OK
> $
Иными словами, если в том коде, который ты привёл, только чуть выше,
есть "use mod_perl;", то результат будет зависеть от версии mod_perl'а
в сборочной среде. Иначе результат всегда будет по ветке else, т.к.
$mod_perl::VERSION даёт undef и undef >= 1.99 даёт false.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-12-08 6:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-06 2:06 [devel] " Alexey Tourbin
2004-12-08 3:36 ` [devel] " Alexey Tourbin
2004-12-08 5:12 ` Alexey I. Froloff
2004-12-08 6:12 ` Alexey Tourbin
2004-12-08 6:53 ` Alexey Tourbin [this message]
2004-12-08 6:57 ` Alexey I. Froloff
2004-12-08 18:30 ` [devel] Re: perl-Apache-DBI Alexey Tourbin
2004-12-13 7:16 ` [devel] I: rpm-build-perl-0.5 Andrey Brindeew
2004-12-13 9:05 ` [devel] " Alexey Tourbin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041208065327.GI30266@solemn.turbinal.org \
--to=at@altlinux.ru \
--cc=devel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git