Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

perl version specific syntax resource

Tags:

perl

Is there a resource on the web that I can look to in order to find perl version (5.8.1 vs current_stable) specific language syntax without having to go to perldoc and switch between versions then search for the language item I'm looking for to see if it exists in the selected version?

This just seems like a crappy way and I figured I'd ask the hive to see if there's better.

For instance, if I search for 'say' I'd like to know that it appeared in perl 5.10+.

Thank you.

edit-- As a note, the reason I'm looking is often I find myself having to support old versions of perl that I "can't" upgrade, yet still need to write code for. This becomes a tedious task when certain things don't work as expected going from 5.12+ to 5.8- and I was just hoping to find a better way (and I figured I can't be the only one in this situation).

edit-- I was basically looking for an all in one reference area ideally available via the web. Click 'say' and find that it's available in v5.10 when the feature is enabled, or that some function learned how to take different arguments in version Z, etc. With many languages, if you go view a core class/lib/module you find a whole version history for its arguments, methods, functions, etc. As far as utilities and modules go, perlver looks nice, as well.

like image 747
AndrewPK Avatar asked Jun 14 '12 20:06

AndrewPK


2 Answers

Another not that nice way is to go through deltas: http://perldoc.perl.org/index-history.html You could always try searching through them:

grep say perl*delta.pod

But yes, this is not nice and easy way.

like image 97
Teftin Avatar answered Oct 21 '22 03:10

Teftin


The only keywords that are version-dependent are documented in the feature doc page:

perldoc feature

The individual keywords also mention when they were added; perldoc -f say includes this:

This keyword is available only when the "say" feature is enabled; see feature. Alternately, include a "use v5.10" or later to the current scope.

It's really a very short list, anyway. Almost everything that works in 5.14 works in 5.6, too.

like image 42
Mark Reed Avatar answered Oct 21 '22 03:10

Mark Reed