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

Updated:   |  Perl (Scripting) articles

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);

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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