I would use local for that:
{
local $tempdir = '/tmp/foo';
test_someting();
}
Most likely you need to wrap all these test_something(...) function calls anyway with your code, and that's a good place to set up the localized test fixtures as well.
I'm wondering a bit how you plan to handle one such function calling another function. Should the fixtures be recreated or not?
sub test_someting2( $tempdir, $aValue ) {
if( $^O !~ /mswin/i ) {
test_someting("$tempdir/$aValue");
} else {
test_someting("$tempdir\\$aValue");
};
}