use strict; my $var1='test'; my $var2='test2'; open HANDLE ">$var1/$var2/blah.conf" or die "Can't create blah"; print HANDLE <