The code should read thus, and I am running perl in sybas usix 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";
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.
Jun 14, 2008 at 04:33 UTC McDarren Added code tags
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.