Re: Beginer's help
by davido (Cardinal) on Feb 16, 2014 at 01:30 UTC
|
Under windows you would follow these steps:
- Install Perl (ActiveState, or Strawberry, for example) as per the vendor's instructions.
- At the DOS prompt (is that what they still call it?) verify that perl, the executable works, by typing perl -v. If that gives you a Perl version number, perl works, and seems to be included in your path properly.
- Type your program in using a text editor. The one you demonstrated for us should be fine. Save it somewhere you can find it later. Give it a name you will remember. Perhaps, "mytest.pl"
- At the DOS prompt, make sure you're in the directory where mytest.pl was saved, and type this: perl mytest.pl
It's been awhile since I did much with Windows, but that really ought to work for you. If it doesn't, let us know what step fails, and what messages you get.
| [reply] [d/l] [select] |
Re: Beginer's help
by tobyink (Canon) on Feb 16, 2014 at 09:10 UTC
|
"I have: C:\Users\proton>_ while the manuals say C:\windows\desktop\. Is this going to make a big difference? How do you change it into the later form?"
If you don't know what this difference signifies, and how it might affect things, then I'd suggest you have some other learning to do before you learn Perl.
In particular, you should be able to answer these questions, otherwise you'll probably find even running Perl scripts at the command line difficult:
- What's the difference between an absolute file path, and a relative file path?
- What does the concept of a "current working directory" mean? How can I find out the current working directory from the command line? And how can I change it?
- How does the current working directory affect the interpretation of relative file paths?
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
| [reply] |
Re: Beginer's help
by Cristoforo (Curate) on Feb 15, 2014 at 23:52 UTC
|
if accessing my DOS start: I have: C:\Users\proton>_ while the manuals say C:\windows\desktop\. Is this going to make a big difference
It shouldn't, depends on how you loaded perl. If it is ActiveState, it should have updated your path variable with the location of your perl.
You might want to get an editor made for programming instead of using Notepad (that comes with Windows). I use Crimson Editor and it does what I need. (You can also download it here.)
Update Seeing the response by syphilis, are you running the program by typing at the command line perl myprogram.pl?
| [reply] |
|
|
| [reply] |
Re: Beginer's help
by syphilis (Archbishop) on Feb 15, 2014 at 23:47 UTC
|
Code follows
What happens when you try to run that code ? What command do you run ? ... and what output do you get ?
Cheers, Rob | [reply] |
Re: Beginer's help
by Anonymous Monk on Feb 16, 2014 at 09:26 UTC
|
| [reply] [d/l] |
|
|
Try help prompt to change the prompt That is particularly unhelpful. It is the same (standard on Windows) prompt, only showing a different path.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial Deltronics
| [reply] |
|
|
| [reply] |
|
|
|
|
|