in reply to Subroutine Produces Output but Fails to Return to Parent
Some remarks:
#build a dynamic sql statement my $Sql_str = &BuildSQLString($cMssFactBag); print $Sql_str; #I print here I get no SQL statement
So far, it looks not too bad, except that you shouldn't be using an ampersand (&) here, unless you know how it alters the behaviour of the subroutine called (circumvents prototypes; without arguments being called, also passes @_ implicitly)
sub BuildSQLString { ... $dynam_Sql_stmt = join(" ",$dynam_Sql_stmt, "from $p_str_tblName where + RECORDXFEREDTOFILE = 'I'"); #I print here I a SQL statement return $dynam_Sql_stmt; }
Where do $p_str_tblName, $dynam_Sql_stmt come into life? May we see what ... stands for?
A few related hints:
However, I recommend to enable strict & warnings in most circumstances.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutine Produces Output but Fails to Return to Parent
by vegasjoe (Sexton) on Jan 18, 2007 at 23:40 UTC |