Re: how to call sub by value in variable



On Aug 20, 3:09 am, "Petr Vileta" <sto...@xxxxxxxxxxxxx> wrote:
Brian McCauley wrote:
It's trivial to use CODE symrefs without switching off use strict.

(\&$sub)->($name);

Yippee :-) This is what I looked for.

No! Please no! The above code is using symrefs but not _obviously_
using symrefs. If you are using symrefs your code should look like it
is. The easiest way to do this to put it in a a "no strict 'refs'"
block.

.