0

i installed active perl in d: and i save my pl file in desktop. how can i run perl file. whenever i run the perl program , the error is Can't open perl script "hello.pl": No such file or directory.. please help me

2
  • 1
    Have you tried running it from the command prompt? Commented Nov 12, 2010 at 11:51
  • 4
    yes, but have you tried running it from the command prompt, to test that the install works, as opposed to having issues with your local web server? Commented Nov 12, 2010 at 12:25

3 Answers 3

2

Your command prompt probably doesn't start pointing at your desktop. Look at the path it gives you ("C:\Users\yourusername>", maybe?). You can either use cd at the terminal to change to the Desktop directory, or move the script to the path where the command prompt starts.

Use dir (Windows) or ls (Linux/Mac) to see what files are in the current directory at the prompt.

Sign up to request clarification or add additional context in comments.

2 Comments

yes Thomas..now i can change the dir. now run the perl program. it works fine thanks
@Jeny : Glad I could help, but a quick note on using SO--please don't change the question after you've asked it; that will just confuse everyone else. Leave this question (perhaps accepting an answer if one has solved the problem), and ask a new one. Thanks!
0

What is the first line of your perl script? Try setting it to #!perl

Usually the association of .pl to perl.exe is taken care of for you when you install Activestate Perl or Strawberry Perl.

If this is not the case, you need to associate the .pl extension with the perl.exe program. To do this you can use Windows Explorer (Tools menu, Folder Options, File Types) or you can open a command prompt window and used the assoc and ftype commands - you'll need to find the full path to perl.exe.

If you add the path of perl.exe to %PATH then you can just type perl myscript.pl foo bar

2 Comments

The hashbang line has no meaning in Perl on Windows.
@Quick Joe Smith: You are wrong. The #! line always has meaning to Perl, irrespective of platform. That way it’s not a portability issue, as it would be if it only paid attention to it on some platforms but ignored it on others.
0

Try walking through the following guides, step by step.

6 Comments

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
My god manuell, you have nothing better to do with your life than running around downvoting 4-year-old answers?
Sorry, I was just reviewing the "Low Quality Post" queue. I am NOT the one who flagged your answer in that queue, nor the one who donwvoted it. As why someone came to your answer in the first place, I have no idea. Is that processing done by some automated scripts?
Fair enough mate. Seems weird of SO to call attention to such a long-dead and obscure question.
Ok, I have just read the links you provided. Seem pretty fine and in target, to me. +1. If the downvote is a recent one, I suspect that there is indeed some human police at work. I will now take a closer look at the date(s) when reviewing. Enforcing policy for recent activity may be a good idea, but doing it for such legacy posts seems not (anyway, adding some "words" to links is better :-)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.