Printing a string in Perl couldn’t be easier, you simply use the print function. If you want to print a line in Perl you simple need to write the following:
print "Hello World!";
Output: Hello World!
Similarly you you print a variable as follows:
my $string = "Hello World!"; print $string; Output: Hello World!