Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When was the -P option removed from perl?

Tags:

perl

When was the -P option removed from perl?

-P causes your script to be run through the C preprocessor before compilation by Perl. (Because both comments and cpp directives begin with the # character, you should avoid starting comments with any words recognized by the C preprocessor such as if, else, or define.)

I was just curious about when it was removed.

like image 452
Erik Bennett Avatar asked Aug 26 '19 04:08

Erik Bennett


2 Answers

The -P option was deprecated in perl 5.10.0 (December 2007) and removed in perl 5.12.0 (April 2010).

like image 111
hobbs Avatar answered Nov 10 '22 22:11

hobbs


I often wonder about these questions when I'm writing about some Perl feature. Since I have most Perls installed, I can look at the right files from each version to discover when it disappears. Command-line switches show up in perlrun, so I can look back at the each perlrun until I find where the switch disappears.

I don't need to have all those Perls installed though. The Perl source is in GitHub, so you can look at the history of the perlrun file to find the change (and here it is where you might start: "Remove the -P switch" - 4c84d7).

The perldelta page also lists the changes for that version (and older versions' perldelta get moved to a versioned form, such as perl5100delta). That's a bit more tedious to go through, especially since you can't bisect it.

Beyond that, Perl 5 Porters will deprecate a feature for two major versions (such as v5.28 and v5.30) before it's actually removed. Back in v5.10 the policy wasn't quite there yet, so that removal was a bit fast.

The curious thing now is that many things were deprecated in v5.000, and Perl 5 Porters are now removing those long-deprecated features.

like image 27
brian d foy Avatar answered Nov 10 '22 21:11

brian d foy