Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I loaded ActivePerl on my Windows 2000 workstation and I cant get Perl to work. I see the Perl directory and everything seems to be loaded. The perl icon does appear in the /Perl/bin/perl and /Perl/bin/perl5.6.1 and /Perl/bin/wperl files but that is the only place I see the perl icon. If I create a test "Hello World" script it doesnt show as a perl icon. It shows the generic Microsoft icon as if Perl doesnt exist and the script doesnt print anything:
use strict; print "Hello World\n";
Is there any settings I need to change to get Perl running on my Windows 2000 workstation??

Replies are listed 'Best First'.
Re: ActivePerl not working
by shenme (Priest) on Sep 24, 2003 at 16:53 UTC
    If you are trying to do all this through Windows Explorer, for instance, be prepared for this UI to 'lie' to you.   The file is probably named "Hello World.pl.txt, which is why it is a standard icon, rather than a Perl icon.   If you open the file again with Notepad (or whatever) and use "File / SaveAs" to explicitly save the file as the name "Hello World.pl" you might start to see it with a Perl icon.
      I tried as suggested and it still doesnt show as a Perl icon and the script doesnt work. Any other suggestions??
        Hmmm, okay, you mentioned that you saw Explorer show you the Perl icons (little yellow 'pearl'?) when displaying /Perl/bin/perl .   Does it also show those same icons for file 'config', which is really named 'config.pl'?   If the same icon doesn't show up for both, then it is as pzbagel mentioned - the file associations haven't been setup.   That should have been done by the ActivePerl install.   If you feel nervous about doing pzbagel's procedure, maybe uninstalling Perl, then reinstalling and _allowing_ the ActivePerl install to update the file associations would be best.
Re: ActivePerl not working
by demerphq (Chancellor) on Sep 24, 2003 at 17:43 UTC

    I'm guessing you installed without sufficient rights to change the registry. Try getting Power User or Administrator rights and reinstalling. The behaviour you describes strongly suggests and incomplete install to me. After installation you should be able to do assoc on .pl files and get a binding to Perl, which itself should be bound to the perl interpreter.

    E:\perl562-21256\perl\win32>(assoc .pl) && (ftype Perl) .pl=Perl Perl="E:\Perl\bin\perl.exe" "%1" %*

    You can try using the same two commands to fix things up, but Perl should have done this for you.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi


      Thanks to all of you! It now works.
Re: ActivePerl not working
by pzbagel (Chaplain) on Sep 24, 2003 at 17:22 UTC

    You probably haven't associated pl files with the perl binary. Open up the explorer and click Tools->"Folder Options". Then click the "File Types" Tab. Create a new association for pl files to open with the perl.exe.

    HTH

Re: ActivePerl not working
by jdtoronto (Prior) on Sep 24, 2003 at 17:19 UTC
    Yep, Windows Explorer will lie unmercifully!

    Using a command window go to the directory where you created the programme, you should be able to type: perl progname.pl (substituting you programme name!) and it will run.

    You need to check file name associations and the PATH to make sure things are going to work as you expect.

    jdtoronto

Re: ActivePerl not working
by jacques (Priest) on Sep 24, 2003 at 17:36 UTC
    Forget about the icon. It's not important. Make sure Perl is in your path. You can set the path through the command line or by right clicking the my computer icon->Properties->Advanced->Enviromental Variables

    By the way, an easier way to test if Perl is in your path is to type 'perl' at the command prompt. There's no need to write a script.