I do not know is it possible to enable GOOFY in sub but You can get the same with __DATA__ like this
"HERE" docs are just another data type. Thus they can exist wherever any other string can live, there's no reason they can't be "enabled in subs". Only, their syntax is that the terminator must be at the beginning of the line, though.