William schreef: > [attribution dammit] Ruud: >> my $number = 0+ $strNumber; >> >> or "in place": >> >> $strNumber += 0; >> >> But there really is no need! The first time you use the variable as a >> number, it will become a number (or rather a numeric reality will be >> added to it), which is used in further numeric contexts > > haha instead of adding and substracting 1 , it's even better adding > zero, > I understand what you are talking about, but there is really a need > for me to convert to number while I am using > the module, Language::Prolog::Yaswi, to convert the perl datatype > into prolog dataatype, which is another language. If I did not do > so, it would treat that as string instead of number. So I think there > is not better way than adding 0.
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? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/