D
dufffman
Hi,
I am new to perl and trying out sample programs right now. I have a
perl script that does some DB work for me, and in the end always
returns me one number that it obtains from the DB. This perl program is
being called by a bourne shell script. What would I need to write at
the end of the perl script so that it returns a value at the end (not
an exit code, and value that I have extracted from the DB)?
Essentially I am treating the perl program as a function, where I give
it a sql, it analyzes it for me (because of its DB friendly libraries
as opposed to shell) and I want it to return me a value. So in my shell
script I will have a statement of the form,
RETURN_VALUE=`$HOME/sqlAnalyzer.pl`
and then I in my shell I could process the RETURN_VALUE variable such
as..
if [ $RETURN_VALUE -ge 10 ]
then
do this...
else
do this...
fi
Help is much appreciated.
Thanks,
I am new to perl and trying out sample programs right now. I have a
perl script that does some DB work for me, and in the end always
returns me one number that it obtains from the DB. This perl program is
being called by a bourne shell script. What would I need to write at
the end of the perl script so that it returns a value at the end (not
an exit code, and value that I have extracted from the DB)?
Essentially I am treating the perl program as a function, where I give
it a sql, it analyzes it for me (because of its DB friendly libraries
as opposed to shell) and I want it to return me a value. So in my shell
script I will have a statement of the form,
RETURN_VALUE=`$HOME/sqlAnalyzer.pl`
and then I in my shell I could process the RETURN_VALUE variable such
as..
if [ $RETURN_VALUE -ge 10 ]
then
do this...
else
do this...
fi
Help is much appreciated.
Thanks,