Also be aware that the list of core modules can vary between versions.
I've never personally encountered a problem with this;
however, if it is an issue for you, you can specify a range of valid versions with
use and no.
Version too old:
$ perl -v | head -2 | tail -1
This is perl 5, version 18, subversion 0 (v5.18.0) built for darwin-th
+read-multi-2level
$ perl -e 'use 5.020; no 5.024'
Perl v5.20.0 required--this is only v5.18.0, stopped at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$
Version too new:
$ perl -v | head -2 | tail -1
This is perl 5, version 24, subversion 0 (v5.24.0) built for darwin-th
+read-multi-2level
$ perl -e 'use 5.020; no 5.024'
Perls since v5.24.0 too modern--this is v5.24.0, stopped at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$
Version just right (Goldilocks zone):
$ perl -v | head -2 | tail -1
This is perl 5, version 22, subversion 0 (v5.22.0) built for darwin-th
+read-multi-2level
$ perl -e 'use 5.020; no 5.024'
$
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.