Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Installation

Status
Not open for further replies.

Stress4Ever

Programmer
Feb 6, 2004
9
0
0
US
I downloaded Active Perl and installed it, is there something else i need to install because when i type in a command (print "hello world";) i keep getting unknown command. Any help would be appreciated thanks
 
You have to put [tt]print "hello world";[/tt] in a plain text file, lets say called 'test.pl', then you run it from the command line via "perl test.pl". You have to get the perl interpreter involved for it to execute code.

There's other OS and command line tricks to execute things, but that's the most common and easiest.

________________________________________
Andrew - Perl Monkey
 
I tried have tried putting it in a file as well, in the &quot;C:\Perl\eg\example.pl&quot; I've also tried typing that out and using just using perl <filename.pl> at the command line nothing works. Ok lets say i type &quot;Perl example.pl&quot; i get back a message &quot;UNKNOWN COMMAND 'Perl' Type help&quot;. The installation did not show any errors. Thanks for ur help
 
Just to add i've only installed activeperl is there someting else i need to install.
 
Where did you install Perl? It may not be in your path. Type &quot;set path&quot; at a prompt to see what all's in there. You can say &quot;set path=%path%;c:\perl\bin&quot; to add perl to your path (assuming that's where you put it), but that only works for that command window. How to set it as a default for all in the future depends on your Windows version.

I think the installer can set the path for you, but you might have to open a new command window to see the changes.

________________________________________
Andrew - Perl Monkey
 
when i type set path a the comand prompt it say &quot;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared&quot; is all that suppose to be there or should i delete everything but the perl directory.
 
that looks like it should be working... the other paths are there for other programs. Try going to the C:\perl\bin directory through Explorer and see if perl.exe is there.
or try using this:
Code:
[b]C:\>[/b]C:\perl\bin\perl.exe C:\Perl\eg\example.pl
 
I tried ur string and then Perl would not load at all, i have another question when i go to &quot;start/programs/activeperl5.8&quot; all i see is OLE Browser, Perl Package Manager, Documentaton. Is that all that should be installed.
 
That's all I got.

If you type [tt]perl -e &quot;print 'hello world'&quot;[/tt] at a command prompt, what happens? Perl's in your path, so it should run. If that doesn't run, you've got serious issues somewhere.

________________________________________
Andrew - Perl Monkey
 
Now when i type perl example.pl it says &quot; cannot open perl script no such file or direcory&quot;.
 
Where is example.pl? It doesn't know by itself, you have to tell it.

________________________________________
Andrew - Perl Monkey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top