Posted by brian d foy on December 11, 2011
Perl’s basic data type is the scalar, which takes its name from the mathematical term for “single item”. However, the scalar is really two things. You probably know that a scalar can be either a number or a string, or a number that looks the same as its string, or a string that can be [...]
Posted by brian d foy on July 31, 2011
Autovivification, although a great feature, might bite you when you don’t expect it. I explained this feature in Understand autovivification, but I didn’t tell you that there’s a way to control it and even turn it off completely. The autovivification pragma, which you can get from CPAN, lets you decide how autovivification works, or doesn’t [...]
Posted by brian d foy on June 5, 2011
Errors from a string eval can be tricky to track down since perl doesn’t tell you where the eval was. It treats each of the string evals as a separate, virtual file because it doesn’t remember where the string argument came from. Since perl compiles that during the run phase (see Know the phases of [...]
Posted by brian d foy on May 22, 2011
Perl lets you override the effects of warn and die by redefining the signals that Perl sends when you call those functions. You probably don’t want to use the signal from die, though, since it might mean a couple of different things. You handle these special signals by setting values in the %SIG hash just [...]
Posted by brian d foy on May 1, 2011
The Git distributed version control system is very popular in with Perlers, and even if you aren’t using it for your own project, you should know how to do simple things with it so you can interact with the most active parts of the community. It’s not that hard. Not only that, many Perl projects [...]
Posted by brian d foy on February 20, 2011
When you’re paying attention to the Perl news about new Perl releases, you need to know which ones matter to you. It seems like a simple question, but there are many things to consider. Do you use an experimental or stable release? In a stable release, which of the supported versions should you use? What [...]
Posted by brian d foy on February 13, 2011
There are several Perl distributions that you might choose, and each of them exists to serve a different audience. No one distribution is the right answer for you, and I can’t tell you which one to use without knowing about your situation and what’s important to you. Your possible solutions range from compiling, installing, and [...]
Posted by brian d foy on January 22, 2011
When you get a new perl, you want to use it right away. Why wait for all that pesky compiling? As soon as the new tarball hits CPAN, you want to download it and start playing with it. You can make that process a little faster by running a parallel make. This week, the Perl [...]
Posted by brian d foy on January 3, 2011
This Item isn’t really about random hex digits, but we thought we’d expand on an Item in the original Effective Perl blog that Joseph set up to support the first edition of Effective Perl Programming. He had an Item titled “Creating a String of Random Hex Digits”. We won’t reproduce it here, so you should [...]
Posted by brian d foy on November 21, 2010
Perl’s a dynamic language, which means you get to change the definition of almost anything while the programming is running. You can even change the defintions of Perl’s built-in subroutine. Once you (or the evil doer who wrote the module you need) change the definition, you might want to get back to the original, and [...]