Here we are again. It seems that, every time I upgrade Xubuntu, I cannot compile old Linux kernels anymore. Last time, it was GNU Make that broke the build. This time it is Perl turn. This is the error I got:
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
In the changelog of version 5.22 (included in Ubuntu 16.04 LTS "Xenial Xerus") is clearly reported that the
defined(arrays) are no longer tolerated, so the only chance to compile my old kernel is to install a previous version.
On the other hand, rolling back to an older version could make some new programs not working anymore or open security holes. The best solution is to use the old Perl version only when needed and the newest one for the normal usage. A quick search with keywords "multiple perl versions" made me find this tutorial that introduces Perlbrew.
Quick and easy! The additional versions (how many you want) of Perl are installed in your home directory and with a simple command you can switch from one to another. In less than 30 minutes I was compiling my old Linux kernel successfully thanks to the guys behind Perlbrew.