#!/usr/bin/perl

print"Hello World\n"; #o/p Hello World

$name = "Perl Scripts";
print '$name'; # o/p $name
print "\n";
print "$name\n"; # o/p Perl Scripts


@cookies = ("camel delites","peanet butter","shortbread","thinmints","sandwich");
print "$cookies[0]\n"; # o/p camel delites
print "$#cookies\n"; # 4

$length=@cookies;
print $length ; # o/p 5
print "\n";

if (@cookies == 0) {
   print "you are in the if statement\n";
   
} else {
	print "you are in the else statement\n";
}

for($i=0; $i <= $#cookies ; $i++) {
	print "$cookies[$i]\n";
}

# associate array

%nameValuePairs=("name" => "Aparna", "email" => "aparna111\@yahoo.com", "phone" => "7195997120");
$name = $nameValuePairs{"name"};
print "$name\n";

print '-'x 10,"\n";

@cookies1 = sort qw (chocolate mint peanut butter mm);
%cookieJug = (chocolate => 10,
              mint => 20,
              peanut => 30,
              butter => 40,
              mm => 50);
              
foreach $type(@cookies1) {
	print "cookie type= $type,noOfBoxes=$cookieJug{$type}\n";
}

print "Enter the cookie shipping just arrived:";
chop($type=<STDIN>);

print "Enter the number of boxes that arrived:";
chop($boxno=<STDIN>);

$boxInStore = $cookieJug{$type};
print "The no. of $type boxes in store before=$boxInStore\n";
$boxInStore += $boxno;

$cookieJug{$type} = $boxInStore;
print "The no. of $type boxes in store after=$boxInStore\n";

