PERL Tutorial Example: print function example in PERL - How to print in PERL

PERL Tutorial Example: print function example in PERL - How to print in PERL?

PERL Example Base Tutorial: print function example in PERL - How to print in PERL?
 

create a file named "perl-tutorial-example-print-function.pl" then copy and paste the below code:

print "\n\n"; # To make line break

print "I like Beef very much\n"; # Print string to Standard Out (STDOUT) & make a new line

print "\n";

print "I like ","Chicken ","also ","\n\n";
# Print comma separated word(s) to Standard Out (STDOUT) & make a new lines

print STDOUT I, like, Computer, "\n\n";
# To print comma separated unquoted word(s) to Standard Out (STDOUT)
# Be careful that there is no comma before and after STDOUT

PERL Example Base Tutorial: print function example in PERL - How to print in PERL?

Now run the program (perl-tutorial-example-print-function.pl) from command prompt and get the desired result as follows:
Note that comments have putted in code for better understanding.

PERL Tutorial Example: print function example in PERL - How to print in PERL? - output in the command prompt

The result in the windows command prompt

No comments:

Post a Comment

leave your comments here..