in reply to Perl6::Rules oddity?

Ya know, as someone still running 5.6, I've never really taken a good look at Perl6::Rules. It never occured to me that the Damain's perl5 implementation would acctually set $0.

That must make for some interesting "ps" output while doing lots of parsing.

Replies are listed 'Best First'.
Re: Re: Perl6::Rules oddity?
by broquaint (Abbot) on May 04, 2004 at 16:26 UTC
    While $0 is used to neat effect its associated perl5 MAGIC is not used, and I quoth from the source
    # Turn off special $0 magic *0 = \ my $zero;
    After that $0 will loose it's magical behaviour e.g
    shell> perl -MDevel::Peek - Dump $0; *0 = \ my $zero; Dump $0; ^D SV = PVMG(0x99900b0) at 0x999410c REFCNT = 1 FLAGS = (GMG,SMG,pPOK) IV = 0 NV = 0 PV = 0x99950e8 "-"\0 CUR = 1 LEN = 2 MAGIC = 0x99950f8 MG_VIRTUAL = &PL_vtbl_sv MG_TYPE = PERL_MAGIC_sv(\0) MG_OBJ = 0x9994100 MG_LEN = 1 MG_PTR = 0x9995118 "0" SV = NULL(0x0) at 0x9997828 REFCNT = 2 FLAGS = (PADBUSY,PADMY)
    Although leaving $0 scrubbing out could certainly lead to some interesting debugging facilities in conjunction with top ;)
    HTH

    _________
    broquaint