June 2005
Beginner
480 pages
10h 31m
English
Now that you've learned what scalar data is and know how to use scalar variables, you can start doing something useful with Perl. Perl programs are just collections of expressions and statements executed in order from the top of your Perl program to the bottom (unless you specify otherwise with flow-control statements, covered in Hour 3, “Controlling the Program's Flow”). Listing 2.1 shows a valid Perl program.
1: #!/usr/bin/perl -w 2: 3: $radius=50; 4: 5: $area=3.14159*($radius ** 2); 6: print $area; |
Line 1: This line is the path to the Perl interpreter, as explained in Hour 1. The -w switch tells Perl to inform you of any warnings encountered.
Line 3: This line is an assignment ...
Read now
Unlock full access