Tinkering with Perl

(Search & Sitemap) > Writing > Miscellaneous Nonfiction > Tinkering with Perl
Skip Back  Previous  10  11  12  13  14  15  16  17  18  19  Next  Skip Forward
Printer-Friendly Version

joe

joe is the name of an easy to use editor for Unix systems. To use joe to create a file called hello_world.pl, type:

joe hello_world.pl

You will now see a screen that is mostly blank. Type control-K (that is, hold the control key and press 'k') and then 'H' to get a help screen. That will bring up on the screen most of the commands you need to know to edit files.

We are going to create our very own program. Type in the following, exactly as you see it on the screen:

#!/usr/local/bin/perl

print "Hello world!\n";

Then type control-K and X to save the file. It will ask you what file to save it as; type:

hello_world.pl

Keep reading to find out how to run the program.

See also:

Unix preliminaries - Files - Editors - Shebang - Permissions

Tinkering with Perl is a free book that provides an introduction to programming in Perl, as well as a basic reference for things like foreach in Perl, if-then, and if-then-else, in addition to providing a glossary where you can find definitions for concatenate and other terms.

Tinkering with Perl may be one of the most popular offerings on this site, but it's not the only attraction. You can read a tongue-in-cheek Game Review: Meatspace, read an even more offbeat customer service survey (whether or not you actually fill it out), and spend a few minutes wishing your boss would read, The Administrator Who Cried, "Important!" (Not to mention that there are other things you can read here besides tech stuff, from Janra Ball: The Headache to The Spectacles.)

Read more...

Top

(Search & Sitemap) > Writing > Miscellaneous Nonfiction > Tinkering with Perl
Skip Back  Previous  10  11  12  13  14  15  16  17  18  19  Next  Skip Forward
Printer-Friendly Version