No such thing as a small change | |
PerlMonks |
Re: Why I get a display "Access is denied" when i run my perl script on my pc?by fizbin (Chaplain) |
on Jan 20, 2007 at 13:17 UTC ( [id://595662]=note: print w/replies, xml ) | Need Help?? |
I've gotten this error sometimes when the perl script has been transferred to the machine with cygwin tools. (e.g. cygwin ssh, ftp, or wget) The issue is that somehow you've managed to get the "execute" permission turned off on that file. This is very unusual on windows, but it's often the normal situation on unix; hence, I've only ever encountered it when I've pulled down a file with cygwin, which emulates a unix environment on windows. In any case, the way to fix this if you have cygwin installed is to do chmod a+x filename.pl. If you don't have cygwin, then I'm puzzled as to how you managed to do this to yourself, but you can fix it by right-clicking on the file in an explorer window, choosing "Properties", then the "Security" tab, then "advanced". When you see the list of "permission entries", choose the one corresponding to your user id, hit "Edit", and make sure that the "Traverse Directory/Execute" permission is enabled. If you are unable to find the problem by looking at your perl script, the problem may be with perl itself. Did you perhaps install Perl by unpacking the zip file with cygwin's unzip? If so, you'll have to make sure that you grant yourself execute permission to basically everything in your perl directory (setting permissions explicitly on the perl directory will give you a chance to automatically apply the permissions all the way down). You can check if the problem is perl itself by seeing if perl scriptname.pl works. If that doesn't work, then the problem is with the permissions on perl. If you're still having trouble, could you tell us:
--
In Section
Seekers of Perl Wisdom
|
|