Path: utzoo!utgpu!watserv1!watmath!iuvax!mailrus!uunet!ksr!chuck From: chuck@ksr.UUCP (Chuck Shavit) Newsgroups: comp.lang.perl Subject: Re: numeric from string Message-ID: <622@ksr.UUCP> Date: 9 Mar 90 14:22:48 GMT References: <13537@cbnewsd.ATT.COM> Organization: Kendall Square Research Corp. Lines: 15 In article <13537@cbnewsd.ATT.COM> weiss@cbnewsd.ATT.COM (edward.j.weiss,ihp,) writes: >Try out: > > perl -e '$m="0777"; $n = $m + 1; print $n,"\n";' > >What should the answer be? > Indeed, the duality of a numeric string (both a binary number and a character string) is buggy. Here is an example: % perl -e '$n = 1984; substr($n,1,3) = "812"; printf "%s %d\n",$n,$n;' Chuck Shavit