Introduction
Perl is a interpreted language. It is almost available in all popular operating systems today. Perl will be similar to C language and awk.

Basics

  • Perl script file mostly will have the extension .pl
  • In unix and Linux flavours, the perl file should have an execution permission.
  • Start the perl script file with #!/usr/bin/perl
  • Dont forget to terminate perl commands with ; (semicolen). eg., print “Hello world\n”;

program 1

Always the first program I try on any language is hello world, so perl’s hello world program is here for Linux and UNIX flavours,

#!/usr/bin/perl
print "Hello world.\n";

In Windows the same program will look like,

#!D:/perl/perl.exe
print "Hello world.\n";
  • The first line (in both examples) is a comment for perl, but for shell it tells which interpriter in what path to use on the file.
  • The second command print is similar to printf in C language with some difference. Lets learn the difference later.

Output

perl_hello_world

Share
Tagged with:
 

Apple expected new tablet

On May 22, 2009, in apple, notebook, products, by mahesh
0


Amazons Tablet

Amazon's Tablet

Apple is beleaved to release a new version of iTouch, this new product is expected to compete with the netbooks available in market and the Amazon’s tablet.

This new product by apple is expected to be out in the market by the first half of next year. Since it is from Apple, it is expected to have multi touch feature. The screen is expected to be 7inch to 10inch.

Apple always maintaines a difference in its products from other brands, is expected to give new features and provide good stebility in this new product as it would compete with large number of netbooks available in market.
From forbes, telegraph

Share
Tagged with:
 

Compare two files in vim

On April 15, 2009, in linux, linux tips, by arul
1


To Compare between two files in linux
“vim -d sample1.c sample2.c”

This Option -d is helpful to compare the newly added changes between two files

Share
Tagged with: