FreeKB - Perl (Scripting) Display text on the console (print and say)
Perl (Scripting) - Display text on the console (print and say)

To display text on the console, print or say can be used. By default, print will not append a new line at the end of a string, thus it is common to see something like this.

print "Hello World\n";


say will automatically append a new line, thus there is no need to add the \n regex.

say "Hello World";


To use say, you must import the say feature.

use feature qw(say);


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter dd7be in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |