develooper Front page | perl.perl5.porters | Postings from November 2003

[DOCPATCH] BEGIN, CHECK, INIT, END explained more

Thread Previous | Thread Next
From:
Tels
Date:
November 30, 2003 07:08
Subject:
[DOCPATCH] BEGIN, CHECK, INIT, END explained more
Message ID:
200311301550.34189@bloodgate.com
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

On Saturday, November 29, 2003, at 10:15  pm, Elizabeth Mattijsen wrote:
>
> $ perl -MO=Deparse -e 'BEGIN { foo => "bar" }'
> sub BEGIN {
>     'foo', 'bar';
> }
> -e syntax OK
>
> $ perl -MO=Deparse -e 'CLONE { foo => "bar" }'
> do {
>     'foo', 'bar'
> }->CLONE;
> -e syntax OK
>

Arthur wrote:

>Because CLONE/DESTROY are called on objects, the mere presence of them 
>does not affect the compilation.

Why is CLONE special, but FOO not? That doesn't follow from Liz' example:

te@null:~/perl/math/Math-BigInt-1.67> perl -MO=Deparse -e 'FOO { foo => 
"bar" }'
do {
    'foo', 'bar'
}->FOO;
- -e syntax OK
te@null:~/perl/math/Math-BigInt-1.67> perl -MO=Deparse -e 'CLONE { foo => 
"bar" }'
do {
    'foo', 'bar'
}->CLONE;
- -e syntax OK

Cheers,

Tels

- -- 
 Signed on Sun Nov 30 15:49:37 2003 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "My name is Felicity Shagwell. Shagwell by name, shag very well by
 reputation."

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBP8oDtXcLPEOTuEwVAQFtYwf+O3bZ/UMQ1314ZqLWXsWCbE/U3neebcYG
jzsQF41Sr8AJmYkz9Ai2G4Z9sUP/oQ20N8F5TrKebzvCi9LBVwA3+3lD1NwNJ6zG
mqzF8tgK4fTZxosHdLcjBphzlDcrtJ+ZEHZ+jvhnrrlvmynK6EoBa4cK0IoAL1Ps
QYiP7LuUNqlHrey9Lb1V505piQy1UA66KPj4UtatQj6sad2gKhTbYqVO8Cr+G7Kz
79znAzAkBhjlQIQej6whoNVdISweQRbOg/ZK4ke691darp0yMeu7oWDQP85a0MsC
LjxJIblen8McxaJp6E1j3n73Q/c6UqEM+2g3orTHB5lbUQ0cQaVRPQ==
=oY6T
-----END PGP SIGNATURE-----


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About