From d5407247046f2f01c1492998b32b3b148445febe Mon Sep 17 00:00:00 2001 From: Zefram Date: Tue, 12 Dec 2017 10:16:46 +0000 Subject: [PATCH] better document version check aspect of "use" --- pod/perlfunc.pod | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 0cf5031..18a5211 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -9389,6 +9389,15 @@ The L method|UNIVERSAL/C>, inherited from the L|UNIVERSAL> class, croaks if the given version is larger than the value of the variable C<$Module::VERSION>. +The VERSION argument cannot be an arbitrary expression. It only counts +as a VERSION argument if it is a version number literal, starting with +either a digit or C followed by a digit. Anything that doesn't +look like a version literal will be parsed as the start of the LIST. +Nevertheless, many attempts to use an arbitrary expression as a VERSION +argument will appear to work, because L's C method +handles numeric arguments specially, performing version checks rather +than treating them as things to export. + Again, there is a distinction between omitting LIST (L|/import LIST> called with no arguments) and an explicit empty LIST C<()> (L|/import LIST> not called). Note that there is no comma -- 1.8.3.1