Next: Variables
Up: Physics 2101 - Scientific
Previous: A Perl Program
Contents
Index
Programming Elements
There are five basic elements of programming that
are present in essentially all languages.
- Variables: This will how data is represented. It
can range from something very simple, such as the age of
a person, to something very complex, such as a record of
university students holding their names, ages, addresses,
what courses they have taken, and the marks obtained.
- Loops: This will allow us to carry out
execution of a group of commands a certain number of times.
- Conditionals: This will specify execution of
a group of statements depending on whether or not some
condition is satisfied.
- Input/Output: This will allow interaction of
the program with external entities. This might be as simple
as printing something out to the terminal screen, or
capturing some text the user types on the keyboard, or
it can involve reading and/or writing to files.
- Subroutines and functions: This will allow
you to put oft-used snippets of code into one location
which can then be used over and over again.
These notes are not meant to be an all-inclusive reference
guide to Perl. You should become very familiar with the
copious documentation that comes with Perl - on Windows,
see the HTML links under the ActivePerl entry in the
Start menu. You can also access the documentation within
a terminal window via perldoc:
C:\> perldoc perl # brings up a table of contents
C:\> perldoc perlintro # introduction to Perl
C:\> perldoc -f rand # quick help on using the rand function
C:\> perldoc File::Copy # help on using the File::Copy module
Finally, there are many good Perl tutorials on the web - do
a Google search for Perl tutorial to start.
Next: Variables
Up: Physics 2101 - Scientific
Previous: A Perl Program
Contents
Index