my $new_vhost_path = "$apache_vhost_base_path/" . $site->{'vhost_server_name'}; if( -e $new_vhost_path ){ return 'ERROR: will not overwrite an existing configuration file:' . $new_vhost_path; } else { my $parent_directory = $new_vhost_path =~ s,^(.*)/(.*),$1,; warn "We hope we can write to: $parent_directory "; if( -w $parent_directory ){ warn "We apparently believe that we can write to: $parent_directory \n"; $self->{'apache'}->save( $new_vhost_path, '-reformat' ); return $new_vhost_path; } else { return 'ERROR: user - ' . $> . ' is unable to create ' . $new_vhost_path; } } }