Comment puis-je retourner une valeur à partir d'un programme en Perl pour un Korn-shell script?

Je veux faire cela dans un script shell:

#!/usr/bin/ksh

PERL_PATH=/usr/local/bin/perl

RET1=$(${PERL_PATH} missing_months_wrap.pl)

echo $RET1

Comment dois-je faire?

appelant le script perl comme ci-dessus me donne une erreur:

> shell.sh
Can't return outside a subroutine at missing_months_wrap.pl line 269.

EDIT: à l'intérieur du script perl les états sont :

unless (@pm1_CS_missing_months)
{
$SETFLAG=1;
}

my @tmp_field_validation = `sqlplus -s $connstr \@DLfields_validation.sql`;

unless (@tmp_field_validation)
{
$SETFLAG=1;
}

if ($SETFLAG==1)
{
return $SETFLAG;
}
Ce n' perl test.pl retour? À la sortie de quelque chose de l'impression sur l'écran?

OriginalL'auteur Vijay | 2010-05-10