sub some_func { my $saveDir = new PreserveWD; # Do stuff }