#!/usr/bin/perl
################################################
###
### My first PERL script
###
################################################
### use "cls" to clear screen for Windows/DOS
system "cls";
### use "clear" to clear screen for UNIX
# system "clear";
### move down a line and print 3 hellos on the same line
print "\n";
$a = "Hello!\t";
$b = "Hello!\n\n";
print $a;
print $a;
print $b;
### print numbers from 1 to 10
print "I can count from 1 to 10\n\n";
$a = 0;
while ($a < 10) {
$a++;
print "$a\n";
}
### move down 2 lines - print a line with backslashes
print "\n\n\\Here's a backslash on both ends\\";
### move down 2 lines - print 3 goodbyes on separate lines
print "\n\n";
$a = 0;
$b = "Goodbye!\n";
while ($a < 3) {
$a++;
print "$b";
}
exit(0);
Back to Dottie's VU Page
To PERL - Page Two
To PERL - Page Three
To PERL - Page Four
To PERL - Page Five