Adding Custom rules to nginx config - virtual_feature.pl

Hello all hope some body can help me I am trying to add custom configuration block to nginx config file to process perl through nginx I bit stuck on how to return virtual domain file path inside this code block below?

File: /usr/share/webmin/virtualmin-nginx/virtual_feature.pl

my $cgi = {
‘type’ => 1,
‘name’ => ‘location’,
‘words’ => [ ‘~’, ‘^/cgi-bin/.*.cgi$’ ],

              	  'members' => [
		{ 'name' => 'root',
		  'words' => [ &virtual_server::public_html_dir($d) ] }, 
this &virtual_server::public_html_dir($d)

writes full vhosts path such as ‘/var/www/vhosts/domain/example.com/httpdocs;’

I need to return ‘/var/www/vhosts/domain/example.com’ only can some please help.

kind regards
Darren