You've been assigned to write a program that counts the regulatory elements in DNA. If you've never programmed you probably have no idea of how to start. Let's talk about what you need to know to write the program.
Here's a summary of the steps we'll cover:
Identify the required inputs, such as data or information given by the user.
Make an overall design for the program, including the general method—the algorithm—by which the program computes the output.
Decide how the outputs will print; for example, to files or displayed graphically.
Refine the overall design by specifying more detail.
Write the Perl program code.
These steps may be different for shorter or longer programs, but this is the general approach you will take for most of your programming.
First, you need to conceive a plan for how the program is going to work. This is the overall design of the program and an important step that's usually done before the actual writing of the program begins. Programs are often compared to kitchen recipes, in that they are specific instructions on how to accomplish some task. For instance, you need an idea of what inputs and outputs the program will have. In our example, the input would be the new DNA. You then need a strategy for how the program will do the necessary computing to calculate the desired output from the input.
In our example, the program first needs to collect information from the user: namely, where is the DNA? (This information can be ...