$word->Options->{DefaultFilePath}->{wdDocumentsPath} = $path_default; #### $word->Options->DefaultFilePath->{wdDocumentsPath} = $path_new; ---> output: Can't use an undefined value as a HASH reference at ....