One possible way (not recommended, although I have used it in the past, a fairly long time ago) to try out new things in a completely different prefix:
Use 2 pkgsrc trees (say one stable, one head).
In the top of each pkgsrc tree, set different mk variables for that tree in a file called
custom.mk - at least:
LOCALBASE= /usr/pkg/stable
PKG_DBDIR= ${LOCALBASE}.pkgdb
and
LOCALBASE= /usr/pkg/head
PKG_DBDIR= ${LOCALBASE}.pkgdb
In /etc/mk.conf, include a stanza that says:
.ifdef BSD_PKG_MK
.endif
Then play man and path games with /usr/pkg/{stable,head}/{bin,sbin} and LD_LIBRARY_PATH to invoke the right binary and library
***HOWEVER***, pkg_install tools have to know which prefix you mean (via PKG_DBDIR), and that involves using shell variables to tie in with the man variables there. I used to have an integrated shell/make setup, but these days - I just use a different VM for stuff like this
Best,
Alistair