Thursday, November 3, 2011

To access an element in an Array

#!/usr/bin/perl
@test=("a","b","c");
print "3rd element is \n @test[2]\n";

Please note array starts with zero,one,two ....
so when we say 2 the element is c on the above example.

No comments:

Post a Comment