length / uc / substr
Try it yourself →Length, uppercase, substring.
Syntax
length($s) · uc($s) · substr($s, start, length)
Description
length length, uc/lc case, substr part (0-indexed), index position. Concatenation is done with .
Example
my $s = "hello"; print length($s), "\n"; print uc($s), "\n"; print "Hex" . "Library", "\n";
Expected output
5 HELLO HexLibrary
When to use?
Text processing (Perl's specialty).
Common mistakes
- ⚠️ String concatenation uses a DOT (.) not +.