in reply to Lexical::Alias & subroutines

Someone else has pointed out this bug, too. I need to look at the source (the icky C source) to figure out what's wrong. It could be a bug... it probably has to do with the way I walk the pad in the module.

As far as changing the order of the parameters, I suppose I could make the module take an argument of "v=a" (variable to alias) or "a=v" (alias to variable).

As far as automagic my(), this is not a source filter, Jenda, it's merely an XS module that does some fancy footwork.

Maybe I'll look at Variable::Alias... have you? Update: ick (sorry BrentDax)... that's just a tie-based module. It won't help me solve my problem.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: Lexical::Alias & subroutines
by Jenda (Abbot) on May 19, 2003 at 14:52 UTC

    Thanks for the info :-)

    I should invest some time in learning about source filters and later try to create a filter on top of your module that would allow me to write this as much as I'd like it as possible :-)

    P.S.: It'd be cool if you found a way to bypass the error in Perl, but I'm afraid I can't help you in this. My C skills are minimal.

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

      Lexical::Alias 0.04 will be coming to CPAN shortly. Two tiny changes -- a $SWAP global you can set to 1 if you want to send the arguments to the functions in the reversed order you specified, and a note about the 5.8.0 bug.

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

        I don't think the $SWAP global is the right implementation. It's too global :-)

        What about having

        alias $original => $alias;
        and
        Alias $alias => $original;
        or something like this. Or at least the SWAPing should be on package level. IHMO of course.

        Thanks, Jenda
        Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
           -- Rick Osborne

        Edit by castaway: Closed small tag in signature