Perl function reference-abs Function - Perl Scripting

What are abs function?

Description

This function is used to return the absolute value of its argument. If exact integer value is passed then it will return it as it is, but if a string is passed then it will return zero. If VALUE is omitted then it uses $_

Syntax

Following is the simple syntax for this function −

Return Value

This function returns the absolute value of its argument.

Example

Following is the example code showing its basic usage −
When above code is executed, it produces the following result −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Perl Scripting Topics