scheidr has asked for the wisdom of the Perl Monks concerning the following question:
Hi I have an embedded perl test script I'm playing with. I'm noticing if I try to assign a variable in perl like $dog, the shell script gives me an error. How can I assign Perl variables in embedded perl script in a UNIX shell.
Here is my script. I have a UNIX and a Perl variable next to each other. How can I display the perl value?
#/bin/ksh fruit=basket pltst() { /usr/bin/perl <<- _perl sub first { $tombstone = 'pizza'; <--- I want to assign this value. HOW?? print "Your ",index($fruit,'k')," and ",oct('65')," other things g +o here. $fruit , $tombstone \n"; } first _perl } # end of shell function pltst mytree=`pltst` echo mytree - $mytree exit 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: assigning a perl variable in shell
by Anonymous Monk on Jan 13, 2015 at 19:14 UTC | |
by scheidr (Novice) on Jan 13, 2015 at 20:22 UTC | |
by eyepopslikeamosquito (Archbishop) on Jan 14, 2015 at 00:31 UTC | |
by scheidr (Novice) on Jan 16, 2015 at 22:39 UTC | |
by soonix (Chancellor) on Jan 17, 2015 at 11:30 UTC | |
by RonW (Parson) on Jan 13, 2015 at 22:43 UTC | |
| |
|
Re: assigning a perl variable in shell
by LanX (Saint) on Jan 13, 2015 at 19:26 UTC | |
by scheidr (Novice) on Jan 13, 2015 at 20:42 UTC | |
by LanX (Saint) on Jan 13, 2015 at 20:48 UTC | |
by Anonymous Monk on Jan 13, 2015 at 23:45 UTC |