So, for example, you could use the following code to test if the file is readable:
if (-r $filename) {
#do stuff here with the file
}
else {
carp "Cannot read file $filename\n";
}
However, it sounds like you may be essentially trying to write a text editor in perl. Why? If userfriendliness is an issue and people don't know how to use emacs/vi, there are plenty of other editors out there that are more userfriendly, like joe. If you have a GUI available, there are gui versions of vi (gvim) or emacs available.
|