my $genpkg = "Symbol::"; my $genseq = 0; sub gensym () { my $name = "GEN" . $genseq++; ## Instantiate the glob and take a reference to it. my $ref = \*{$genpkg . $name}; ## Delete the name, leaving a reference to an anonymous glob delete $$genpkg{$name}; ## return the ref $ref; } #### $r = do{ \local *FRED };; print $r;; GLOB(0x4055f70)