The chop() function in Perl is used to remove the last character from the input string.
String : It is the input string whose last characters are removed.
Returns: the last removed character.
Chopped String is : GfG is a computer science porta Removed character is : l
Chopped String is : [1, 2, 3 Removed character is : ]
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.