>Will Fould wrote:
> package mypackage;
> my($myvar)=();
> my $r=Apache2::RequestUtil->request;
> $myvar=$r->dir_config('BAR');


From what I can see, you're only issue is that you've duplicated
package mypackage;

make that

package X; # for vhost1 and script1
package Y; # for vhosts2 and script2

$ GET "http://v1.test.p6m7g8.net/perlsetvar?cv=v1"
v1 => 1
$ GET "http://v1.test.p6m7g8.net/perlsetvar?cv=v2"
v2 => NOT DEFINED
$ GET "http://v2.test.p6m7g8.net/perlsetvar?cv=v2"
v2 => 2
$ GET "http://v2.test.p6m7g8.net/perlsetvar?cv=v1"
v1 => NOT DEFINED
$ GET "http://v2.test.p6m7g8.net/perlsetvar?cv=v2"
v2 => 2
$ GET "http://v1.test.p6m7g8.net/perlsetvar?cv=v2"
v2 => NOT DEFINED
$ GET "http://v1.test.p6m7g8.net/perlsetvar?cv=v1"
v1 => 1

Source Code:
http://test.p6m7g8.net/TEST/PerlSetVar.pm

Virtual Host Configs:
http://test.p6m7g8.net/TEST/net.p6m7g8.net.test.v1.conf
http://test.p6m7g8.net/TEST/net.p6m7g8.net.test.v2.conf


--
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F 6A47 D55A 7172 A799 97F

When I call your name, Girl, it starts to flame
Burning in my heart, Tearing it all apart..
No matter how I try My love I cannot hide....