in reply to Re^2: Wierd Behavior With Tie
in thread Wierd Behavior With Tie

On the other hand, the pit bull in me has my teeth into tying variables

Tied variables are pretty slow, and they don't always work due to bugs. That's why I suggested the alternative.

Closest I've been able to come so far is this wrapper

The variable you called $tied isn't tied. That's why it works. If you fix the variable name, you get:

sub call { my $sub = shift; return $sub->(@_); }

You basically took the solution I already posted and put it in a function.

I got rid of the misleading/broken/wrong prototype. Don't use prototypes unless you have a good reason and you understand the problems associated with using them.

Replies are listed 'Best First'.
Re^4: Wierd Behavior With Tie
by rational_icthus (Sexton) on Jun 02, 2006 at 22:49 UTC
    Credit where credit's due, I took a look at my implementation, plus Limbic~Region's fix, and by the time I had everything working I was implementing your sub inside a tied variable.

    Goodbye, tie.

    Thanks for the comments and suggestions.