Hi Wayne,
The last commit on the Guiguts repository was a little over three years ago. If I were in your place, I might fork the repository, for example on GitHub, and start making my commits there (an excellent resource on learning Git is the Git Book). That way, changes would be public and other users could benefit from them, and if the developers are still active, they could pull selected changes back into their code.
You don't need to know a ton of Perl for basic debugging tasks - a lot of my debugging needs are covered by Data::Dump, e.g. use Data::Dump 'pp'; and then at strategic places pp $variable;. What might also be helpful is use Carp 'cluck';, then cluck "test"; will give you stack traces. And as you begin to understand more and more Perl, that will help in posting better questions, such as locating the source of problems by boiling the code down to the minimum needed for others to be able to reproduce the problem.
Of course we're happy to help, and if I made it sound too much like you already need to know Perl before asking questions here, that's not the case - you should have the willingness to learn Perl :-)
Regards, -- Hauke D
| [reply] [d/l] [select] |
Thank you Hauke
There is a lot of information in your response! I'm not sure I am qualified to fork the code though.
From the documentation you supplied on File::Temp it would appear that every instance of the file would be read only and the "readonly" test should not be needed, the file permissions should be changed on save. Am I on the right track with this logic?
Regards, Wayne
| [reply] |
Hi Wayne,
every instance of the file would be read only and the "readonly" test should not be needed, the file permissions should be changed on save
As far as I can tell files created by File::Temp should normally be 0600 (read+write for the owner and no access to anyone else). By "readonly test" I assume you're referring to the function fileisreadonly in the OP (source). The way I understand that code is that the check is applied before the file is saved, so that in case the user is trying to write to a file that is readonly, the user is first asked if they want to overwrite the file anyway.
It would make sense to me that a file is left with read+write permissions for the owner after the save - at least I've never seen someone set their umask so that the owner's permissions are restricted. The idea behind the code I suggested is that the file permissions should be determined by the user's umask, so that the user can choose whether they want the files to be 0666, 0644, 0664, 0640, or whatever other combination they like, instead of the files always ending up 0600.
Hope this helps, -- Hauke D
| [reply] [d/l] |