Perl Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 5.00

String Built-in Functions and Performance

This chapter provides tutorial examples and notes about string built-in functions and performance. Topics include string built-in functions: chop(), length(), index(), substr() and split() functions; Perl functions are 2 times slower than Java functions.

String Related Built-in Functions

Performance of Perl substr() and index()

Performance of Java substring() and indexOf()

Conclusions:

  • chop(), length(), index(), substr() and split() are commonly used Perl built-in functions to manipulate strings.
  • Perl substr() and index() functions are 2 times slower than Java substring() and indexOf() functions.

Dr. Herong Yang, updated in 2008
String Built-in Functions and Performance