#!/user/bin/perl
use warnings;
use strict;
my %hash=("shrikant",23,"shruti",23,"mahesh",22,"santosh",24,"gururaj",43);
print "\n ENTER YOUR NAME:";
my $name=<STDIN>;
chomp($name);
print $hash{$name},"\n";
my @list=(1,2,3,4,5);
print "\n the size of the array", ($#list+1),"\n";
my $i=0;
while($i!=($#list+1))
{
print $list[$i],"\t";
$i++;
}
print "\n";
@list=undef;# this line indicate the undefineing the array
No comments:
Post a Comment