> There is no real way to test if a value inside a variable has a numeric > "personality". Variables can have multiple "personalities", each with > there own binary value. > > So maybe the problem just comes from the leading zeroes that your > sprintf format added?
Not exactly from the leading zeros, use Data::Dumper; my $numStr = sprintf("%4d", 1234); print (Dumper $numStr), "\n"; my $numStr = sprintf("%05d", 1234); print (Dumper $numStr), "\n"; my $num = sprintf("%05d", 1234); $num += 0; print (Dumper $num), "\n"; use Language::Prolog::Types::overload; use Language::Prolog::Types qw(:ctors); print prolog_functor('foo', $numStr), "\n"; print prolog_functor('foo', $num), "\n"; $VAR1 = '1234'; $VAR1 = '01234'; $VAR1 = 1234; foo(01234) foo(1234) As you can see the last of $VAR1 does not have single quote, so it's really in number data type. The problem is I need to use the number variable in prolog_functor function This is module that serve as a glue between Perl and Programming Logic (Prolog) language, if it's not in number data type it will become a string in Prolog language (in Prolog it is called atom). I think so far, adding zero solve the problem. Thanks. Send instant messages to your online friends http://uk.messenger.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/