The code should read thus, and I am running perl in sybase
unix attaching to sql database:
my($ddate,$paydate);
$ddate = '20080609';
print STDOUT "DATE $ddate\n";
$pay_date = get_medate($ddate);
print STDOUT "back in call $pay_date\n";
.
.
.
exit(0);
sub get_medate {
use strict 'vars';
my($dte) = "select max(calendar_date) from
business_days_table where substring(calendar_date,1,6)
=substring('$ddte',1,6) and is_NYSE_open = 'Y' and
is_bank_holiday='N'";
print STDOUT "$mesql\n";
my($gt_cursor)=$scb_db->prepare($mesql);
$gt_cursor->execute;
my($medate) = $gt_cursor->fetchrow ;
print STDOUT "MEDATE IN SUB $medate\n";
return $medate;
}
I get the print from the subroutine, I get no print from the calling line or after.