in reply to Assigning to the CODE slot of a GLOB whose REF is held in a lexical?

$globref = \do{ local *GLOB} }; {local *X = $globref; *X = sub {"bar"}};
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.)