Quote of the day

Tuesday, June 12, 2007

Perl coding section

# ---> is used for comment
helloworld.pl

print"Hello World";

helloname.pl

print"Enter your name : ";
$n=; # to get input
chomp $n; # to remove the trailing spaces in the statement
print"Hello $n. How are you doing?";

Addition of two numbers

print"Enter value of a : ";
$a=;
print"Enter value of b : ";
$b=;
$c=$a+$b;
print"Answer is $c";

No comments: