in reply to Questions about Calling Perl from a Shell...
So, if ksh behaves the same way, you can put quotes around PERL and leave off the backslashes: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 \<newline> is ignored, and \ must be used to quote the characters \, $, and `.
That approach works for me in bash.#!/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"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Questions about Calling Perl from a Shell...
by TheOtherGuy (Sexton) on Jan 09, 2001 at 02:53 UTC |