in reply to Assigning to the CODE slot of a GLOB whose REF is held in a lexical?
should do the trick. I think it's a bug that *$globref = $coderef doesn't work. (Or $arrayref, $scalarref, $hashref, $formatref, $ioref, for that matter.)$globref = \do{ local *GLOB} }; {local *X = $globref; *X = sub {"bar"}};
|
|---|