Tuesday, October 14, 2008

More about Arrays

Get Array length
#!/usr/bin/perl -w

@myarray=(1,2,3,4,5,6,7,8,9);

$len=@myarray;

print("length of the Array : $len");


@ARGV is the array that contains the command line arguments.
example:
#!/usr/bin/perl -w

print("First Argument is : $ARGV[0]\n");

print("First Argument is : $ARGV[1]\n");

print("First Argument is : $ARGV[2]\n");

print("First Argument is : $ARGV[3]\n");

No comments: