R
R. Cheung
I have a problem using sprintf in my embedded Perl interpreter. E.g.
$decVal = 1234;
$str = sprintf( "Result is %d, 0x%x", $decVal, $decVal );
$str comes back containing rubbish like "Result is 17 0x11". It seems
that sprintf can pick up the 1st parameter (the format string) but
picks up completely wrong parameters subsequently. The interpreter
seems to work fine when doing strictly Perl stuff (e.g. matching,
substituting, etc.). I'm wondering if this is a symbol clash problem.
I'm working in a Win2000 environment, embedding Perl in a Visual C++
application. Could it be that it's picking up sprintf from the VC++
library instead of Perl's own, or something like that? Does anyone
have a solution to this problem? Thanks.
$decVal = 1234;
$str = sprintf( "Result is %d, 0x%x", $decVal, $decVal );
$str comes back containing rubbish like "Result is 17 0x11". It seems
that sprintf can pick up the 1st parameter (the format string) but
picks up completely wrong parameters subsequently. The interpreter
seems to work fine when doing strictly Perl stuff (e.g. matching,
substituting, etc.). I'm wondering if this is a symbol clash problem.
I'm working in a Win2000 environment, embedding Perl in a Visual C++
application. Could it be that it's picking up sprintf from the VC++
library instead of Perl's own, or something like that? Does anyone
have a solution to this problem? Thanks.