Use of here document in PERL
create a file named "perl-tutorial-example-here-document.pl" then copy and paste the below code:
print <<EOF; Use of here document in PERL.\n Here it is.\n EOF print "\n\n"; print <<'EOF2'; Use of here document in PERL.\n It is same but another way.\n EOF2 print "\n\n"; # VARIABLE IN PERL HERE DOCUMENT $MyVariable="Variable"; print <<EOF_VARIABLE; Use of here document in PERL.\n It is the use of $MyVariable in PERL here document.\n EOF_VARIABLE
Use of here document in PERL
Now run the program (perl-tutorial-example-here-document.pl) from command prompt & get some interesting results as follows:

No comments:
Post a Comment
leave your comments here..