Shell Escaping: There are several methods for escaping special characters in the Linux shell: Double quotes: Double-quoted strings require escaping of only a few characters. Example: >echo “Some String: &>|\”\$’\`\s\\” Some String: &>|”$’`\s\ This method is useful as long as…
Category: Perl Programming
utf8::decode() may actually unset the UTF-8 flag
According to the documentation, the utf8::decode() function should generally set/turn on the UTF-8 flag for a string that contains multi-byte characters. However, apparently, there are circumstances under which utf8::decode() may not only not set the flag, but may actually unset/clear/turn…
Perl: Default to UTF-8 encoding
The UTF-8 (Unicode) character encoding system is a well supported alternative to the older ISO-8859-1 (Latin-1) system that can make it easier to work with special characters and multiple languages. Many developers can exercise sufficient control over their system to…
Perl access to local install of the W3C CSS validator
The W3C CSS validator is an online service for checking a stylesheet for standards compliance. This service can be accessed in Perl via the WebService::Validator::CSS::W3C module, which is handy for automating validation. However, for checking a large number of stylesheets, it is…
Perl global error handler
This is in an Apache::ASP based system, but should theoretically work in any web environment. I wanted to create a global default error handler ($SIG{__DIE__}) that displays the error text on the page. Some notes: It is generally recommended that…
Perl regular expressions – limit
Just ran into a limitation of Perl regular expressions. It’s mentioned (in brackets!) here: http://www.foo.be/docs/tpj/issues/vol1_2/tpj0102-0006.html, but I didn’t see mention of it in the Perl manual, so this wasn’t easy to track down. It’s stated as: “Perl currently has an…