in reply to Tk::NoteBook references

You forgot a dereference. Change
   $$n{_pages_}{$page}->Button(-text=>'Hi')->pack();
to
   $$n->{_pages_}{$page}->Button(-text=>'Hi')->pack();
and things work fine.

You should probably remove the extra level of indirection though. Just use $notebook instead of \$notebook in the sub call, and then $n instead of $$n in the callback