Akim Demaille <[EMAIL PROTECTED]> writes:

> I don't know how to fix the `use strict refs' part.  In particular, it
> dies on computed sub names:

>       & $my_sub ();

> fails, and I don't know how to rewrite it the way strict refs wants it.

You can't.  You have to do something like:

    { no strict 'refs'; &$my_sub(); }

(no strict is lexically scoped).  Preventing you from doing that is the
point of use strict 'refs', since computed subs like that are considered
to be an advanced feature and a mistake more often than intentional.  :)

(If you want to rewrite the code, you can use a hash of sub refs instead
of the computed name method, but that isn't always any cleaner or more
readable.)

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to