Introduction to Perl

Week 2
These are the topics that we shall cover during the second week. 

Why Perl?

Hello world!

  1. Logon to smb.ctp.bilkent.edu.tr (You should have obtained an account on this computer by now. If you have not yet done so, see Mr. Satuk Erculasun in the CTP systems room)
  2. Use vi to enter the following code into a file (hello.pl) ( See "Just enough vi commands to survive" and the "vi tutorial" for some help on using the "vi" editor)
print "Hello world!\n";
  1. Run your program with the command "perl ./hello.pl"
  2. Modify the hello.pl file so that it contains the lines
#!/usr/bin/perl
print "Hello world\n";
  1. Modify the access rights to allow execution by everyone (Hint : use the chmod command)
  2. Run the new program with the command "./hello.pl"

Perl Variables

Basic I/O

I/O From Standard I/O Devices  : 

print STDOUT, "text to print";
print "text to pr
int";

$name = <STDIN>;
chomp($name);
print "You have entered $name\n";

Flow Control

Conversions