Why can't I use "say" with version 5.14

J

John Black

perl -v reveals that I have version 5.14 installed but the "say" command does not work unless
I include this line:

use feature ':5.10';

Shouldn't 5.10 features already be default in 5.14??

John Black
 
J

John Black

No. That's the whole point of feature.pm: you might already have a
pre-5.10 program which uses a 'say' sub, and if 5.10 (or 5.14) turned
the builtin on by default that program would stop working.

From 5.10 onwards, 'use 5.010' will call 'use feature ":5.10"' in
addition to the compile-time check for perl 5.10. The same applies for
later versions of perl. This means you can put 'use VERSION' at the top
of each file along with strict and warnings and that file will continue
to use the semantics of the version you wrote it for even on future
versions of perl.

(Incidentally, 'use 5.012' and later also imply 'use strict'...)

Ben

Thanks!

John Black
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top