#build a dynamic sql statement my $Sql_str = &BuildSQLString($cMssFactBag); print $Sql_str; #I print here I get no SQL statement #### 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; }