Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
hashes
$data{'Hunt'} = 100; $data{'Benji'} = 200; $data{'Faust'} = 40; $data{'Lane'} = 20; %data = ('apple', 145, 'mango', 130, 'banana', 140); %data = ('reg' => 255, 'green' => 124, 'blue' => 10); %data = ('Aishwarya' => 85, 'Amipara' => 90, 'Anshal' => 80); @names = keys %data; print "$names[0]\n"; print "$names[1]\n"; print "$names[2]\n"; %data = ('Aishwarya' => 85, 'Amipara' => 90, 'Anshal' => 80); @marks = values %data; print "$marks[0]\n"; print "$marks[1]\n"; print "$marks[2]\n"; %data = ('Aishwarya' => 85, 'Amipara' => 90, 'Anshal' => 80); if( exists($data{'Lisa'} ) ) { print "Lisa marks are $data{'Lisa'}\n"; } else { print "I don't know marks of Lisa\n"; } %data = ('Aishwarya' => 85, 'Amipara' => 90, 'Anshal' => 80); @keys = keys %data; $size = @keys; print "1 - Hash size: is $size\n"; @values = values %data; $size = @values; print "2 - Hash size: is $size\n"; %data = ('Aishwarya' => 85, 'Amipara' => 90, 'Anshal' => 80); $data{'Anthony'} = 75; delete $data{'Anshal'};
run
|
edit
|
history
|
help
0
Quotes
Basics
version tester
key_hash_function
perl plot circular list in a circle
5_5
Perl logo
Perl programs
Attractive Numbers
2nd