Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL length Function
Syntax
Definition and Usage
Returns the length, in characters, of the value of EXPR, or $_ if not specified. Use scalar
context on an array or hash if you want to determine the corresponding size.
Return Value
Example
Try out following example:
#!/usr/bin/perl
$orig_string = "This is Test and CAPITAL";
$string_len = length( orig_string );
print "Length of String is : $string_len\n";
It will produce following result
Length of String is : 11
|
|

|
|
|