1

I am trying to get Strawberry perl running on my windows 8 machine. This is my first attempt ever to use perl and I am going through the readme file to try and get it up and running. At the moment i have got as far as typing

c:\>perl

and i get access denied message. Am i misunderstanding the readme or do i need to make some further adjustments to get it to work?

The instrustions for the readme are

1. run any perl script by launching

 c:\> perl c:\path\to\script.pl

i have also tried

c:\>perl c:\perls\ex1.pl

where perls is the folder on C: in which the script ex1 is located. Also get access denied message.

TLP
  • 66,756
  • 10
  • 92
  • 149
CSnewb
  • 147
  • 4
  • 13
  • I'm not too familiar with Win8 (stuck in XPland) but this sounds like permissions problem with your installation. I would recommend posting on SuperUser, possibly – DVK Dec 30 '13 at 22:23
  • 1
    For starters, find the directory where you installed Perl (say, "c:\program files\strawberry\bin\" and run Perl as full path: "c:\program files\strawberry\bin\perl c:\perls\ex1.pl". If that works, you will simply need to add Perl's directory to `PATH` variable – DVK Dec 30 '13 at 22:24
  • For permissions, see: http://windows.microsoft.com/en-us/windows7/how-do-i-open-a-file-if-i-get-an-access-denied-message – DVK Dec 30 '13 at 22:26
  • okay that seems to have done the trick. Only catch was that there is also a folder named perls from the install which i put directly on C: so it ended up being c:\strawberry\perl\bin\perl – CSnewb Dec 30 '13 at 22:37
  • Did you type `c:>perl` like you said? Because that is a command `c:` with a redirection `>` to a file `perl`, which on my system gives the exact error `Access denied`. – TLP Dec 30 '13 at 22:37
  • 1
    Try and type `perl -e "print 'Hello world'"` in a cmd shell and see if that works as expected. – TLP Dec 30 '13 at 22:38
  • That worked. Thank you guys, now for endless hours of fun laying with perl. – CSnewb Dec 30 '13 at 22:48
  • @CSnewb - which one worked? using full path? – DVK Dec 30 '13 at 23:04
  • @DVK I suspect he tried typing the prompt: `c:>perl`. – TLP Dec 30 '13 at 23:17
  • 1
    @TLP, Good catch! Make it an answer. – ikegami Dec 30 '13 at 23:28
  • @TLP - unless I'm completely out of my mind, wouldn't typing that simply execute "C:" command to switch current directory to the C: drive's active directory, and redirect the (empty) output into a file called "perl"? **UPDATE**: See proof test: http://pastebin.com/jZVJYKu2 – DVK Dec 30 '13 at 23:45
  • @DVK It seems that the folder `c:\ ` is protected, at least on my system. So that would explain things. On the other hand, if you have installed perl under `c:\perl`, it would not work either. – TLP Dec 31 '13 at 04:12

2 Answers2

1

Posting comment as answer.

The command

c:\>perl

in the windows cmd shell is an instruction to redirect the output of the command c:\ to a file named perl. The > character is the one that does that.

I was going to say that it fails because you probably have a directory named perl there, but I notice on my system that it fails even though I have no such directory.

The problem is that the readme had included the prompt in their sample command. The default prompt in windows cmd looks like that: C:\> So, like I mentioned in the comments, the command you need to run perl is simply perl. For example:

perl -e "print 'Hello world!'"
TLP
  • 66,756
  • 10
  • 92
  • 149
0

It could be either the fact that Perl isn't in your PATH, or permissions issue.


If it's the PATH, to troubleshoot and fix:


If it's permissions, here's a reference: http://windows.microsoft.com/en-us/windows7/how-do-i-open-a-file-if-i-get-an-access-denied-message

Community
  • 1
  • 1
DVK
  • 126,886
  • 32
  • 213
  • 327