Easy Computer Programming

66,475

55

72

Published

Introduction: Easy Computer Programming

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

    • Casting Contest

      Casting Contest
    • Oil Contest

      Oil Contest
    • Clocks Contest

      Clocks Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    72 Comments

    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.

    trollolololololololololololololololololololo

    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)

    RJL makes trojans in Delphi and MS C++ sometimes C# studio and even Visual studio

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

    3 replies

    or he needs to wee really badly

    He needs to wee so badly he dislocated his leg.

    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

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

    hey does active perl work with vista

    this is good but you should add how to write more complex programs

    5 replies

    his idea of a complex program is probably... bye world

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

    oh blizkrieg....i think he just destroyed u 100 times over

    i have a tut on how to do this "a better tut on how to script in perl"

    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

    iMacs have integrated Linux capabilities search for Terminal.app I don't know about Perl, but I know for sure you can do Python