Reputation: 201
I have a shell script , i want to call a perl script to do some compute, once perl is called i want perl to process it and while returning i want it to return not exit code but a string back to shell script ? how can i do that?
Here is my simple piece of code calling perl in shell script VAR=$(perl Test.pl)
Upvotes: 1
Views: 1745
Reputation: 1404
Quick and dirty would be to have the perl script print
the Information to STDOUT and just call it in your Shell script by backticks or just as you did.
Along the lines of
VAR=`perl Test.pl`
This will put everything the perl script printed to STDOUT into VAR.
Upvotes: 2