Enable new Perl features when you need themStarting with Perl 5.10, you must explicitly enable new features. This ensures that the latest release of Perl can be backward compatible while at the same time letting people start new work using all of the latest nifty features.
For instance, Perl 5.10 adds a say built-in that is just like print except that it adds the trailing newline for you. Not only is your string a couple of characters shorter, but you don’t have to double-quote the string just for the newline:
If someone had already created their own say, their program might break if they run it with Perl 5.10 using the now built-in with the same name. Fortunately, Perl doesn’t enable new features by default:
If you want the new features, you can enable them with the new -E switch. It’s just like the -e that lets you specify your program text on the command line, but it also brings in the all of the latest features for your version of Perl:
% perl5.10.1 -E say.pl # use new features up to 5.10.1% perl5.12.0 -E say.pl # use new features up to 5.12.0