Programming
All tutorials in Programming
Sort By:    Name   Rating   Views  Comments    Date 
Browse Pages :    <<  <  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  >  >> 
Reading a Database
Submitted 24 April 2008

Here it is broken down: The first two lines declare the variables Conn and SQLTemp. The next six lines open a connection to your database, and get all the rows from the table. The following Do While Not loop lets u display the data inside the row. The next four lines print out the value of each column in that row. The last bit moves to the next row, ends the loop, and closes the connection to the...

Views: 562 Comments: 0
What Is Perl?
Submitted 28 April 2008

Perl is an acronym, short for Practical Extraction and Report Language. It was designed by Larry Wall as a tool for writing programs in the UNIX environment and is continually being updated and maintained by him. For its many fans, Perl provides the best of several worlds

Views: 418 Comments: 0
Running a Perl Program
Submitted 28 April 2008

Using your favorite editor, type the previous program and save it in a file called program1_1. Tell the system that this file contains executable statements. To do this in the UNIX environment, enter the command $ chmod +x program1_1 Run the program by entering the command $ program1_1

Views: 351 Comments: 0

The first character in the line, the # character, is the Perl comment character. It tells the system that this line is not an executable instruction. The ! character is a special character; it indicates what type of program this is. (You don't need to worry about the details of what the ! character does. All you have to do is remember to include it.) The path /usr/local/bin/perl is the location of...

Views: 334 Comments: 0

The line of code you have just seen is an example of a Perl statement. Basically, a statement is one task for the Perl interpreter to perform. A Perl program can be thought of as a collection of statements performed one at a time. When the Perl interpreter sees a statement, it breaks the statement down into smaller units of information. In this example, the smaller units of information are...

Views: 280 Comments: 0
Line 3: Writing to Standard Output
Submitted 28 April 2008

This statement refers to the library function that is called print. Library functions, such as print, are provided as part of the Perl interpreter; each library function performs a useful task.The print function's task is to send data to the standard output file. The standard output file stores data that is to be written to your screen. The standard output file sometimes appears in Perl programs...

Views: 300 Comments: 0

This section tells you more about variables such as $inputline and how to assign values to these variables.The variable $inputline is an example of a scalar variable. A scalar variable stores exactly one item-a line of input, a piece of text, or a number, for example. Items that can be stored in scalar variables are called scalar values.

Views: 386 Comments: 0
Expressions
Submitted 28 April 2008

Now that you know a little more about operators, operands, and how they both work, it's time to learn some more terminology as well as the details about exactly what Perl is doing when it evaluates operators such as the arithmetic operators and the assignment operator. In Perl, a collection of operators and operands is known as an expression. Each expression yields a result, which is the value you...

Views: 300 Comments: 0
The if Statement
Submitted 28 April 2008

The first part of an if statement-the part between the parentheses-is the conditional expression associated with the if statement. This conditional expression is just like any other expression you've seen so far; in fact, you can use any legal Perl expression as a conditional expression. When the Perl interpreter sees a conditional expression, it evaluates the expression. The result of the...

Views: 362 Comments: 0

The conditional statements you've seen so far enable the Perl interpreter to decide between alternatives. However, each statement in the Perl programs that you have seen is either not executed or is executed only once. Perl also enables you to write conditional statements that tell the Perl interpreter to repeat a block of statements a specified number of times. A block of statements that can be...

Views: 618 Comments: 0
Using Octal and Hexadecimal Notation
Submitted 28 April 2008

If you are not familiar with octal and hexadecimal notations and would like to learn more, read the following sections. These sections explain how to convert numbers to different bases. If you are familiar with this concept, you can skip to the section called "Character Strings."

Views: 367 Comments: 0
Character Strings
Submitted 28 April 2008

Character strings that are enclosed in double quotes accept escape sequences for special characters. These escape sequences consist of a backslash (\) followed by one or more characters. The most common escape sequence is \n, which represents the newline character as shown in this example:

Views: 390 Comments: 0

As you've seen, you can use a scalar variable to store a character string, an integer, or a floating-point value. In scalar variables, a value that was assigned as a string can be used as an integer whenever it makes sense to do so, and vice versa.

Views: 380 Comments: 0
Using the Arithmetic Operators
Submitted 28 April 2008

When an exponentiation operator is employed, the base value (the value to the left of the **) is the number to be repeatedly multiplied. The number to the right, called the exponent, is the number of times the multiplication is to be performed. Here are some other simple examples of the exponentiation operator

Views: 558 Comments: 0
Using Comparison Operators
Submitted 28 April 2008

I'm not sure exactly why this is true; I think it's related to the way the English language is spoken. (Normally, we say, "If I had five dollars, I'd buy some milk," instead of, "If five dollars had I, I'd buy some milk," even though both are correct.)

Views: 498 Comments: 0
Browse Pages :    <<  <  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  >  >>