Location of Perl
Although this may seem obvious, Perl is useful only when users can find it easily. When
possible, it’s good for both /usr/bin/perl and /usr/local/bin/perl to be symlinks to the
actual binary. If that can’t be done, system administrators are strongly
encouraged to put Perl and its accompanying utilities into a directory
typically found along a user’s standard PATH, or in some other obvious and convenient
place.
In this book, we use the standard #!/usr/bin/perl notation on the first line of
the program to mean whatever particular mechanism works on your system.
If you care about running a specific version of Perl, use a specific
path:
#!/usr/local/bin/perl5.14.0
If you just want to be running at least some version number but don’t mind higher ones, place a statement like this near the top of your program:
use v5.14;
(Note: Ancient versions of Perl used numbers like “5.005” or “5.004_05”. Nowadays we would think of those as
v5.5.0 and v5.4.5, but versions of Perl older than v5.6.0 won’t
understand that notation. The use
5. form is safest to ensure
backward compatibility stretching back into the previous millennium.)NNN
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access