may be worth skimming. It describes the basic differences
between PG ( a domain specific language (DSL) developed with in perl)
and perl itself. With that knowledge you can write new macros
from scratch and help debug existing macros.
It is often a good idea to see if the functionality you seek
has already been provided by the extensive PG macro library.