I don't think windows supports shebang notation. You probably need to either set up a .pl file assoc or type "perl cmdname.pl." UPDATE: Other than reinstalling your ActivePerl, no, not really. I try not to use windows if I can help it. But I can tell you than in my windows, I can in fact run my perl scripts; so I know it's possible. I tend to call "perl filename.pl" instead though, because I'm never quite sure what windows will do if I'm not specific.
| [reply] |
| [reply] |
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:
- Whether perl scriptname.pl works (or what error message it gives if it doesn't)?
- What cacls scriptname.pl shows?
--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/;
map{y/X_/\n /;print}map{pop@$_}@/for@/
| [reply] [d/l] [select] |
Hi,
I did unzip all my perl file by using cygwin. But when i ran perl my.pl, it worked.
the result for executing the cacls my.pl is:
Microsoft Windows XP Version 5.1.2600
C:\Mc2_v2\Metcalf1\bin>cacls metcalf.pl
C:\Mc2_v2\Metcalf1\bin\Metcalf.pl WTAM\cxu:(special access:)
STANDARD_RIGHTS_ALL
DELETE
READ_CONTROL
WRITE_DAC
WRITE_OWNER
SYNCHRONIZE
STANDARD_RIGHTS_REQUIRED
FILE_GENERIC_READ
FILE_GENERIC_WRITE
FILE_READ_DATA
FILE_WRITE_DATA
FILE_APPEND_DATA
FILE_READ_EA
FILE_WRITE_EA
FILE_READ_ATTRIBUTES FILE_WRITE_ATTRIBUTES
BUILTIN\Users:(special access:)
READ_CONTROL
SYNCHRONIZE
FILE_GENERIC_READ
FILE_READ_DATA
FILE_READ_EA
FILE_READ_ATTRIBUTES
Everyone:(special access:)
READ_CONTROL
SYNCHRONIZE
FILE_GENERIC_READ
FILE_READ_DATA
FILE_READ_EA
FILE_READ_ATTRIBUTES
Thanks,
Cindy
| [reply] |
Which Perl do you have installed? ActiveState? If not, give it a shot; I had some great successes with it the last time I had to do anything Perl wise in Windows (which, admittedly, was a while ago). | [reply] |
Hi,
my perl version is v5.8.2 built for MSWin32-x86-multi-thread.
I think it is the ActiveState perl
Any idea why it doesn't work??
Thanks
C.
| [reply] |
Did you install it using the *.MSI installer file or did you use the *.ZIP file? The installer sets up the file associations for you.I see that you are using an older version of Perl. Perhaps uninstall it and try installing the latest version. Otherwise have a look here. However, I don't think it is a file association problem. If the file associations are not right, you get a request to choose a program to run your file, not an "access is denied" box. It looks to me that this has something to do with you not being authorized to access that file or the script runs all right but then does something you have no authority to do.
CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
| [reply] [d/l] [select] |
Hmm.... you said you were running this from the command line; what is the exact command that you are using from the prompt to run the script?
| [reply] |