Confirmed, note that the `$M` is highlighted because it is _syntax_ not because the name is known, you can remove the `use M` and it still highlights.
I don't know Perl much, and its possible that `$M::anything` is the appropriate syntax to highlight, but it won't depend on the package contents. The syntax highlighting is supplied by the Scintilla lexer Geany uses, which is a separate project [here](www.scintilla.org). You may wish to post a feature request there since you can then discuss it with the Perl lexer maintainer directly.