Easy Computer Programming by leevonk
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.
 
Remove these adsRemove these ads by Signing Up

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).
trollolo says: Sep 20, 2012. 12:49 PM
trollolololololololololololololololololololo
White_Wolf says: Nov 26, 2010. 11:00 AM
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)
shoyru_master_11 says: Apr 1, 2010. 5:05 PM
RJL makes trojans in Delphi and MS C++ sometimes C# studio and even Visual studio
radiorental says: Jun 8, 2006. 11:29 AM
the green dino's leg in the last frame is dislocated. I recommend getting him medical attention immediately.
radiorental says: Jun 8, 2006. 11:29 AM
or he needs to wee really badly
bowmaster says: Jan 11, 2010. 4:39 PM
He needs to wee so badly he dislocated his leg.
bmlbytes says: Nov 5, 2006. 5:12 PM
HA!
Golem says: Dec 17, 2006. 5:02 PM
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.
bowmaster says: Jan 11, 2010. 4:36 PM
Object-orientation was introduced on version 5.6, 5.10 is the newest version.
saleh5139 says: Aug 17, 2009. 2:58 AM
hey does active perl work with vista
righthandofthedevil says: Apr 12, 2008. 9:31 PM
this looks cool but i have a mac. do u know how to do this type of thing on a mac?
The_Vinninator says: Feb 22, 2009. 2:01 PM
iMacs have integrated Linux capabilities search for Terminal.app I don't know about Perl, but I know for sure you can do Python
tinkerC says: Jul 12, 2009. 5:03 PM
Perl is also part of the package of Mac OS X
Archive555 says: Jun 8, 2008. 8:04 PM
Search around, there are many free alternative programs for many coding languages out there for the mac, do a google search.
tinkerC says: Jul 12, 2009. 5:02 PM
I like the Sam's Teach Yourself C in 21 Days. Unfortunately, that and its sequel are no longer published.
WarPig137 says: May 14, 2009. 5:38 PM
Thanks! Awesome Instructable. I always wanted to program, but I'm lazy. This helped... It could walk a blindman with no hands through a "Hello, World!".
Barrettkg says: Feb 24, 2009. 5:15 PM
TextPad works good for Java (C+) You can run, compile, and it's FREE You download it through SunJava
The_Vinninator says: Feb 22, 2009. 2:00 PM
you're totally right, Sam's is a great series I also like For Dummies, but they're a little expensive LIBRARY!
andrew101 says: Aug 28, 2007. 8:44 PM
this is good but you should add how to write more complex programs
cris1133 says: Jan 12, 2008. 7:07 AM
i have a tut on how to do this "a better tut on how to script in perl"
bengerszewski says: Jul 7, 2008. 4:48 PM
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
BLIzKrIEg says: Aug 31, 2007. 7:00 PM
his idea of a complex program is probably... bye world
leevonk (author) says: Sep 1, 2007. 12:08 PM
not quite,.. but close,.. I write programs that interface animal brains with robotic actuators and sensors
dowd95 says: Jul 23, 2009. 10:39 PM
oh blizkrieg....i think he just destroyed u 100 times over
TJ 47065 says: May 13, 2008. 1:18 PM
Hi, great instructable i think its good that you showed us how to do this, even if there is a better way(who cares). But i dont see why people are being evil about your instructable.
smidge147 says: May 12, 2008. 8:14 AM
I have the sams teach your self book and it sucks and explains bugger all.
naikrovek says: Jun 7, 2006. 7:37 PM
If you install ActivePerl correctly (add perl.exe to the system path), you do not need to run your programs from C:\perl. I would *definitely* create a directory to test in rather than putting my Perl programs in c:\perl, where ActiveState installs perl.
leevonk (author) says: Jun 7, 2006. 11:55 PM
how does one "add perl.exe to the system path". And subsequently how does that allow one to put programs in other directories (I never bothered in the past so I don't know how)
cris1133 says: Jan 14, 2008. 5:14 PM
for god sakes! go to dos prompt and type setpath
radiorental says: Jun 8, 2006. 11:19 AM
on older system one added it to the autoexec.bat but one is not sure how it is done these days with cmd.com
BruceR says: Jun 9, 2006. 2:55 AM
On Windows 2000 or XP you do the following. right click on "My Computer" click on Properties click on the Advanced tab click on Environment Variables select Path from the bottom frame and click on Edit Add the path to the folder where perl.exe is (eg. c:\perl) to the end of the variable name seperated by a ; (semi colon) from the previous entries.
cris1133 says: Jan 3, 2008. 2:18 PM
you an learn how to mnake more advanced scripts in my tut "a better tut on how to script in perl"
cris1133 says: Jan 3, 2008. 2:11 PM
the \n makes the next line that you print print out on another line and #!\user\bin\perl allows your perl interpeter to go in to interactive mode the same,reason that you need >>> in python
TSBob says: Oct 11, 2006. 6:45 AM
You should think about finding a professional to do the work for you ;)
leevonk (author) says: Dec 6, 2006. 1:44 PM
programming is tedious, but easy. I've written a lot more than hello world programs and in more languages than most professionals have used.
BLIzKrIEg says: Aug 31, 2007. 6:59 PM
lol.. go apply for a job at microsoft.... tell them... THE BEST PART ABOUT HIRING ME IS.... I CAN MAKE HELLO WORLD PROGRAMS in C#, visual basic, C++, C, JAVA.
munchman says: Dec 19, 2007. 2:19 PM
For goodness sakes! Just because this guy posts an Instructable about making a hello world program you think that that is the extent of his programming knowledge?
Astrolmonkey says: Jan 2, 2007. 2:11 PM
Well, I've been programming since 7th grade, making that 4 1/2 years (61/2 if you can count a graphing calculator in 5th grade!:), and have learned BASIC, c++, java, ADA, and some assembler, and now can add perl to my list after picking it up after reading your instructable. Thank you.
munchman says: Dec 19, 2007. 2:16 PM
WOW! Nice job.
g_c_c says: Jun 15, 2006. 2:35 AM
Sorry about that, hit the post comment before I was done typing. Long story short, why perl over python or VBScript? Perl is probably the hardest to read and definately has the weakest set of system tools of the three. Obviously I am partial to Python myself, but again- why not VBScript? This tutorial seems geared towards the Windows programmer and VBScript is both easy to use and comes built in to windows. seems an odd choice.
BlessedWrath says: Nov 27, 2007. 11:30 AM
You say VBScript comes with Windows? How should I access this? Are there any tutorials for using it?
stasterisk says: Sep 3, 2007. 5:47 PM
My favorite perl reference: http://www.steve.gb.com/perl/index.html
BLIzKrIEg says: Aug 31, 2007. 7:06 PM
before i am temped to post more comments pointing out your idiocy..... a lot of people are pointing it out also.. except for the people that dont know the fact that making something say helloworld is easier that you make it..... so since so many have pointed it out... go think about your instructable for a moment... why is it helpful?? nothing about HOW and WHYS of it.. just type this in.. you just have to have it.. thats not very clear... so you should just edit it instead of replying to every negative comment with a insult.. eh? how bout that for thought?
leevonk (author) says: Sep 1, 2007. 12:03 PM
I think you need to have sex
BLIzKrIEg says: Aug 27, 2007. 10:15 AM
why would you want hello world to show up in your cmd? ...... and you should just go and get net beans or visual studio .. instead of using things like perl
leevonk (author) says: Aug 27, 2007. 10:21 AM
thanks retard, try reading the 'note' right above.
BLIzKrIEg says: Aug 31, 2007. 6:55 PM
why.. your welcome.. no no you shouldnt thank me.. i must thank you for telling me how to make something that says.. hello world??!!! and why even use perl? if you want it that simple you can just make one using windows notepad that only requires about 1 min.. installing crappy out of date software.. no? am i wrong? "#!/usr/bin/env perl is some crap you have to put at the start of all your programs." that isnt some crap you have to put at the start of all your programs.. .what if your programming with different software? nothing as S#*%y as perl.. eh? and what is your next instructable going be about??? how to make cmd say bye bye world?
leevonk (author) says: Sep 1, 2007. 12:02 PM
uhm, doosh, ... I did use notepad
munalemj says: Mar 10, 2007. 1:42 AM
blah, blah, blah.. one thing i like in this instructable is that the writer's trying to say that programming is easy yet he wrote this: #!/usr/bin/env perl is some crap you have to put at the start of all your programs. Most people would ask: Why do we put that line if it's just crap? and why should we put "\n" if it's unnecessary.. hMM!
leevonk (author) says: Mar 10, 2007. 2:35 AM
good observations, are you a detective? You seem really smart. can you teach me?
HOMEPIE64 says: Mar 8, 2007. 6:43 PM
i gota say not bad anyone wanting to learn C++ go to http://www.cplusplus.com/doc/tutorial/
lemonie says: Jan 16, 2007. 5:29 PM
I've seen electical stores program ZX Spectrums (in Spectrum BASIC) to produce 'rainbow' borders. It's essentially this: 10 BORDER 1: BORDER 2: BORDER 3: BORDER 4: BORDER 5: BORDER 6: BORDER 7: BORDER 8: BORDER 9: BORDER 0 20 GOTO 10 (forgive the syntax if it's incorrect, I forget) 'Hello world' would be: 10 PRINT "Hello world" or for repetition add the GOTO line...
lemonie says: Jan 16, 2007. 5:31 PM
Oh, no. I programmed the border, they were doing something like 'hello world' - GOTO.
allen says: Aug 29, 2006. 6:16 PM
Oh man, is that ever the wrongest way to show someone programming. Before you can do your first "Hello world!" program you, the soon to be programmer, has to download, install and understand how to interact with ActivePerl. Trivial for anyone with even a modest technical background, an arcane series of actions to anyone who's trying to get their first "Hello world!" to work. The real hell of it is that anyone who's reading this is looking at a much easier, more accesible, more immediately interesting environment then ActivePerl: HTML/Javascript and all the rest of the browser-side foo-faraw. You can build web pages! And see them! And add lots of "blink" tags! And stylesheets! Oooh! This is starting to look like something interesting. How about mouseovers and graphics? External links? The concept of the file system? Now you've got something for the student to be enthusiastic about, since they can show off their modest creation to friends all over the world. Imagine what you could do if you knew even more, little proto-programmer? Oh yeah, we need a preview button and a spell-checker for the comments section. I hate it when I read a comment I've just posted and there's that boner sentence that I didn't see until it was out of the text box.
leevonk (author) says: Dec 6, 2006. 1:37 PM
then write an instructable fool
Simmons says: Jun 23, 2006. 4:24 PM
dude i've got a perl book that tells the 'hello world' program.
leevonk (author) says: Jun 26, 2006. 1:09 AM
yeah, a program that prints out 'hello world' is the traditional beginners program for learning any computer language (Perl, c++, basic, etc.etc)
Simmons says: Jun 20, 2006. 2:00 PM
HEy it works!! i deleted AS version and all the files then tried the MSI again and it worked. Then command prompt brought it up. Thanks.
Simmons says: Jun 20, 2006. 10:28 AM
ok. I had to use the AS package because the MSI did not work for some reason. It said something was missing so i went to the AS one. I downloaded it and opened the folder. When i clicked on the 'Installer' MS-DOS batch file, it would come up and go away quickly before i could see what it said. Then if i typed in command prompt 'perl' space '-v'. It doesn't open or is not reconizable. I think i will try re-downloading.
oniony says: Jun 15, 2006. 2:30 PM
In addition, "#!/usr/bin/env perl" is a better way of declaring that the file is Perl as it doesn't require Perl to be installed in a particular directory on each machine the program is to run on. Otherwise, if you put your program on a Unix variant such as Linux, the program may not run.
leevonk (author) says: Jun 19, 2006. 10:54 PM
thanks for those clarifications, I added them to the project text.
Simmons says: Jun 19, 2006. 4:58 PM
I'm having troubl with the AS package. I don;t think the installer works or maybe i cannot find it. any help would help.
leevonk (author) says: Jun 19, 2006. 10:40 PM
describe your problem more clearly. Look at the second picture in the second step of the project, did you download the "MSI" or the "AS package". You should download and install the MSI first, if it doesn't work, only then try the AS package. To run the installer all you have to do is double click on the file that you downloaded (MSI or AS package). So download the stuff to your desktop so it's easy to find/double click on.
leevonk (author) says: Jun 19, 2006. 10:45 PM
Do you mean that you used the DOS prompt to see if it installed correctly and nothing showed up when you typed perl -v? make sure you put a space between 'perl' and '-v'
oniony says: Jun 15, 2006. 2:27 PM
To save a file with an alternative extension in Notepad, change the "Save as type" to "Any file" in the "Save File" window or put the entire name in quotes "hello.pl".
g_c_c says: Jun 15, 2006. 2:24 AM
#! /usr/bin/env python print "Hello World!"
radiorental says: Jun 8, 2006. 11:27 AM
In addition to perl, I highly recommend getting your head around html. While the Sam books are good I find the 'Head First' books much more intuitive and well thought out.

If you're like me and get really bored with reading after a while and find your attention drifting then definitely get something from the Head First Series. I wish I had these at school.

http://www.oreilly.com/store/series/headfirst.csp

The Head First HTML/DHTML/CSS is so easy to read you will be coding web pages in no time. I havent used Perl but to the best of my knowledge it is a scripting language, if you wanted to become more of a 'coder' I would recommend looking at something Object Orientated such as Java.
leevonk (author) says: Jun 8, 2006. 12:52 PM
html was the first thing close to coding that I learned, and I learned it with the first edition of this book 'HTML Visual QuickStart Guide':
http://www.amazon.com/gp/product/0201354934/102-7783616-1096912?v=glance&n=283155

it is fantastic, incredibly easy to learn from. Teaches you visualy (hence 'visual quickstart') by showing you lots of screenshots, etc.
radiorental says: Jun 8, 2006. 1:04 PM
I have a few visual quickstart books. Hed First is a completely different concept (visually) definitely for the A.D.D. mindset.
Ismael says: Jun 7, 2006. 6:42 PM
You should include some links to more extensive tutorials. Something to get people more into Perl after they done the timeless Hello World. Also, you should explain what's that /usr/bin stuff and what does the \n do. Just in case the author doesn't: \n is the command to print a newline /usr/bin/perl is the way to tell some linux shells where to look for the interpreter. In linux you just run the script, you don't have to tell Perl to run it.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!