Easy Computer Programming

67,060

55

72

About: www.leevonk.com

A very EASY and FREE way for ANYONE to write their first computer program in TEN MINUTES.

Note:
This instructable is for people that think that programming is some sort of magical thing that you need expensive programs or high tech skills to do. Hopefully this instructable will remove the veil from their eyes to show them that it is easy and accessible to anyone with a computer. If you want to learn more, buy a book. The 'Sam's Teach Yourself ... in 30 days' books are good.

Step 1: Get the Necessary Stuff

we'll be programming in the Perl programming language because it's very easy to use and free. Also, you can easily integrate it with the internet, etc.

So, you'll need a 'Perl Interpreter' to understand the code you type. Get ActivePerl (a Perl interpreter) here:

http://www.activestate.com/Products/ActivePerl/

click download, enter fake name, etc
If using windows download the MSI, if it doesn't work download the AS package instead.

once downloaded, install it (just double click it, then use all the default options in the install).

Step 2: Check to See If You Installed It Correctly

if you're paranoid and want to see if it was installed correctly, go to the DOS prompt and type: perl -v
it should show you all the version information.

to open the DOS prompt either:

A) Find it in the start menu (see image below: "Start", "Programs", "Accessories", "Command Prompt")

OR

B)you can just click "Start" then "Run" and type cmd.exe in the window that appears.

Step 3: Write Your First Program

start up a text editor (like 'notepad.exe' which comes with windows; Do -NOT- use word or wordpad, they add invisible stuff to the text!). You can find notepad in the same part of the start menu as the DOS prompt (see pic in previous step).
I like to use EditPad.exe which I got free from the internet: http://www.editpadpro.com/editpadclassic.html

write your first program:

#!/usr/bin/env perl
print "Hello, World!\n";

save it as hello.pl (make sure you save it with .pl as the extension, not hello.pl.txt).

To make sure the '.txt' doesn't get added automatically to your filename, click 'Any file(".")' next to 'Save as type'. (see picture below)

Also, to make it easier to test, save it in the c:\Perl\ directory (or wherever you installed the Perl interpreter, by default it installs in c:\Perl\).


#!/usr/bin/env perl
is some crap you have to put at the start of all your programs.

\n
is the symbol for a new line. So when Perl sees this it moves the cursor to the next line (like when you press the return key)

Step 4: Run Your Program

go to the DOS command prompt (or DOS window in windows), go to the Perl interpreter directory, for instance c:\perl\

if you don't know how to change directories in DOS, this is how you would do that: cd c:\perl

then type perl -w hello.pl
(you could also just type hello.pl if you associated .pl files with the Perl interpreter during installation)

you should see Hello World!

yay!!, your program works!! If not, then you messed up/skipped one of the steps above.

Step 5: Write Better Programs!

To write more interesting programs find example code on the internet or buy a book. I've always been pleased with the 'Sams Teach Yourself ... in 21 days" books.

Here are a some good websites to learn more Perl from (found by googling: Perl tutorial)
http://www.pageresource.com/cgirec/index2.htm
http://www.sthomas.net/oldpages/roberts-perl-tutorial.htm
http://www.ebb.org/PickingUpPerl/

=============================================================
The "Sam's Teach Yourself ... in 21 days" are excellent books to learn _ANY_ programming language (I've used them for several):
Great Programming Books

I got the cartoon below from: http://www.qwantz.com/peoplearecool.html

Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Optics Contest

      Optics Contest
    • Plastics Contest

      Plastics Contest

    72 Discussions

    0
    None
    philips05

    2 years ago

    This is good website which describes the <a href="http://www.zeepedia.com/answers/question-category/programming/">programming</a> in comprehensive way. This is best for beginners but I think complex coding should also be provided.

    0
    None
    White_Wolf

    7 years ago on Introduction

    I love perl.. I used to write many perl scripts for interfacing a GPS with google maps and MirC.
    I use a program called OptiPerl.
    Almost a WYSIWYG
    :0)

    0
    None
    radiorental

    12 years ago on Step 5

    the green dino's leg in the last frame is dislocated. I recommend getting him medical attention immediately.

    3 replies
    0
    None
    Golem

    11 years ago

    A few years ago, I learned Perl while developing an application in it to conduct and analyze an on-line survey for my graduate degree. It was very intense, and took a lot of debugging especially due to Perl's non object-orientation. Consequently, I haven't used Perl since then. If I were to learn to use another "web-oriented" programming language, it definitely wouldn't be Perl. Use a programming language which was developed as an object-oriented language from the start and it should have excellent debugging tools too.

    1 reply
    0
    None
    bowmasterGolem

    Reply 8 years ago on Introduction

    Object-orientation was introduced on version 5.6, 5.10 is the newest version.

    0
    None
    saleh5139

    9 years ago on Step 3

    hey does active perl work with vista

    0
    None
    leevonkBLIzKrIEg

    Reply 11 years ago on Introduction

    not quite,.. but close,.. I write programs that interface animal brains with robotic actuators and sensors

    0
    None
    bengerszewskicris1133

    Reply 10 years ago on Introduction

    i'll check that out! this one didn't work for me... i'm using 5.10 something or other, and dos doesn't recognize the command to run the script... damn