Perl: use feature ‘say’;

More self-tutoring about Perl: the tutor mentions another way to enable ‘say’ in Perl.

In my post from Aug 15 I mention the Perl feature say and that, to enable it, a user might key

use v5.10;

below the she-bang line. (Apparently, a version past 5.10 may also suffice.)

I’ve read since that the line

use feature ‘say’;

also enables the use of say.

Source:

perldoc.perl.org

www.sthomas.net

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Using say in Perl

Tutoring computer science, new language ideas will always be noticed. The tutor mentions the Perl construct say.

use v5.10; #Apparently you need this to use say.
$var1=”Hey there:)”;
say $var1; #same effect as print “$var1\n”;

I’ve never known of say, but I tried it on a console and indeed, it works. I needed to include use v5.10; for say to work. I understand, however, that the version can be higher.

Source:

perldoc.perl.org

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.