The format of here-documents is as follows: <<[-]word here-document delimiter No parameter expansion, command substitution, pathname expansion, or arithmetic expansion is performed on word. If any characters in word are quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded. Otherwise, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter case, the pair \ is ignored, and \ must be used to quote the characters \, $, and `. #### #!/bin/ksh USERNAME=`perl <<'PERL' use MyUtils::Database qw(ReadResource); my %db_info; &ReadResource("$ENV{RCFILE}", "REPORT", %db_info); print "$db_info{USERNAME}"; PERL` echo "USERNAME is $USERNAME"