Still having trouble with Perl

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Still having trouble with Perl

Postby tryin_to_learn » 08. November 2008 02:04

I've installed the Perl add-on, run setup_xampp.bat file, restarted Apache. Status shows that Perl is running. However, I right click on the pl file I'm wanting to run, open with cmd.exe, and try running the script and get this:

Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\xampp\htdocs\__shrinkOffice\tools\NPPES>export.pl

Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\xampp\htdocs\__shrinkOffice\tools\NPPES>perl export.pl
'perl' is not recognized as an internal or external command,
operable program or batch file.

As you can see, I've tried just entering the file name (export.pl) and also entering perl export.pl - neither seems to work. Anyone have any ideas?
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Postby Sharley » 08. November 2008 03:04

Try perl.exe not just perl and make sure the path to your perl installation is reflected in the first line of the script (shebang).
For example:
#!"C:\xampp\perl\bin\perl.exe"

I have just tried it on my PC and both perl and perl.exe work for me at the command console.
I also have the shebang in all my perl scripts.

Try this but change the path to perl to your own - this was my test script:
Code: Select all
#!C:/xampp/perl/bin/perl

print "Content-Type: text/html\n\n";

print "OK";


If that fails then?????
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Postby tryin_to_learn » 08. November 2008 04:14

I tried perl.exe - also used your test script with the shebang line (my path is the same as yours) and I'm still getting the same results:

Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\xampp\htdocs\__shrinkOffice\tools\NPPES>susanTest.pl
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\xampp\htdocs\__shrinkOffice\tools\NPPES>perl susanTest.pl
'perl' is not recognized as an internal or external command,
operable program or batch file.

C:\xampp\htdocs\__shrinkOffice\tools\NPPES>perl.exe susanTest.pl
'perl.exe' is not recognized as an internal or external command,
operable program or batch file.
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Postby Sharley » 08. November 2008 04:45

What Os are you using? Vista perhaps - Microsoft Windows [Version 6.0.6000] ?

If Vista then you may have to run your Command Console with elevated administrator privileges.

I posted a mini tutorial for another member here:
http://community.apachefriends.org/f/viewtopi ... 394#128394

Hope this helps.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Postby tryin_to_learn » 08. November 2008 05:48

Yes, unfortunately I have Vista and you may be on to something. I turned the UAC off within about an hour of having this computer. I was going nuts.

The "Open Command Prompt here" is a good trick - I was having to browse to cmd.exe each time. However, I still get the same results that I posted above. It seems like it's not seeing perl.exe, right?
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Postby Sharley » 08. November 2008 06:01

Did you elevate the command prompt Console?

Try and see if you can run the perl script in the conventional manner by using your browser with XAMPP running - put the script in the C:\xampp\cgi-bin and call the script like this:
http://localhost/cgi-bin/susanTest.pl
or whatever you call the script.

You can also test if perl is working by going to...
http://localhost
...and from the left hand menu select Perl and click through the links and also the PerlInfo() link which is much like the phpinfo() information screen.

If all that works then you have those admin issues with Vista and need to elevate the command console.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Postby tryin_to_learn » 09. November 2008 16:05

Both the localhost . . . susanTest.pl and the perlinfo() link work just fine so I think you're right about it being the Vista admin issues. I finally got it to work by accessing the command prompt from Start>Run - that seems to automatically put me in the administrator mode (prompt is C:\Users\Susan) and from there, I could just navigate to the file I needed and run it. Thanks so much for your help. I learned a lot!
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 125 guests