{

Learn free perl tutorials


How do I compare two strings or numbers in Perl with an example

December 1, 2022 ·  2 min read

This tutorial explains How to check given two strings are equal or not in Perl Check whether Two Strings are equal or not in Perl There are multiple ways we can compare whether strings are equal or not. use Compare(cmp) operator cmp compares two strings, and returns 0,-1,1 operand1 cmp operand2 Returns 0 if operand1 and operand2 are equal Returns -1 if operand1 is less than or equal to operand2 Returns 1 if operand1 is greater than or equal to operand2...


How to Print hash key and value in Perl with an example

December 1, 2022 ·  3 min read

This short tutorial shows you how to print the hash key and value in Per with examples. Hash is a data type in Perl that contains key and value pairs. hash can be declared with its values as given below my $emp = { "one" => 1, "two" => 2, "three" => 3, }; Perl Print Hash Object Hash Object printed to console in multiple ways. print used to print the values....


Subscribe
You'll get a notification every time a post gets published here.