Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!ames!coherent!mrspoc!mrspoc!pablo From: pablo@mrspoc.Transact.COM (Pablo Sanchez) Newsgroups: comp.lang.perl Subject: Converting a string to a number Message-ID: Date: 13 Jul 90 17:01:53 GMT Sender: pablo@mrspoc.Transact.COM (Pablo Sanchez) Reply-To: pablo@transact.com Distribution: comp Organization: Transact Software, Inc., Los Altos, CA Lines: 23 Hi there, I'm on a XENIX 386 (2.3.2) running Perl 3.0 pl 18. My code is doing something very simple. I'm reading in a text line that has a number assigned to it (e.g. "ROW_ORIGIN 8") and I need to get the number portion out. Once I get the number portion out, I wish to convert this to a number. I thought I could do it one way, but have had to work around it... Here's the first way I thought I could do it: $last_screen_line[0] =+ 0 ; # convert to a number But on my system, this always prints out zero. So instead I had to do the following: $last_screen_line[0] = $last_screen_line[0] + 0 ; Has this been reported already (or is it a feature :-) )? -- Pablo Sanchez Tomic Drop (tom' ik drop) n. "Factory testing" of a Transact Software, Inc cat to assure oneself the "always lands on its pablo@transact.com feet" principle still holds true.