Both 5.22 and 5.24 killed off some important old Perl 5 behaviour, so many old scripts and modules will fail when upgrading, if they have not been appropriately modified to use newer behaviour. See the
perldelta for each release for details, there's a long list of incompatibilities and deprecations for 5.22.0 and 5.24.0. 5.20 also had similar, but it's been out for long enough that most modules caught up with it a while ago.
5.24 is very recent, and not something I would particularly recommend for production use at this point in time, simply because it is very rare for a Perl installation to exist without a large number of extra modules, and it takes time for the modules to become stable on a new stable release of the core. 5.22 is somewhere between the two, as you would expect, not quite "so old that everything now works, if the module hasn't been completely abandoned", but no longer "bleeding edge, with lots of broken stuff". All of the most popular stuff should now generally be good on 5.22, but you could easily run into the odd module which is still in need of an update.
Either 5.20 or 5.22 are the safer options, but be aware that they (inappropriately and unnecessarily, in my opinion) euthanised
CGI.pm in 5.22, which may cause significant problems for many web-related scripts.
5.20 is still the FreeBSD default version (defined in
Mk/bsd.default-versions.mk). 5.20 in ports is patched for the latest (not actually all that important, or urgent, for many use cases, in my opinion) CVE.
You are correct in wanting to migrate forwards from 5.18, as it's really getting to be "too old" now.