Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Perl Programming quiz, level Advanced, question 36
Question: If you've got a Perl application that's running very slowly, and it uses a lot of regular expressions, which of these is most likely to speed things up without too much effort?
Answer 1: Try to decrease the number of optional parts in your regular expressions, and increase the number of characters that must match exactly.
This was the CORRECT answer
Answer 2: Combine a series of simple regular expressions into one larger one so that the regular expression engine doesn't have to be primed too many times.
Answer 3: Use the variable $& to capture the matching string, rather than using $1, &~036;2 etc.
Answer 4: Use the -O2 command line option to make the compiler optimise your program to be run-time efficient
Answer 5: Eliminate as many anchors and assertations as possible from the regular expression

This was a question from our quiz ... but we have now provided you with the answer (above) - we prefer to provide you with information rather than to puzzle you.
Lua
PHP
Perl
Java
MySQL
Python
Linux
Apache Tomcat
Apache httpd
C and C++
Tcl and Tcl/Tk
Hotel
Recent additions


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2010: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 344596 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho