Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!hansm From: hansm@cs.kun.nl (Hans Mulder) Newsgroups: comp.lang.perl Subject: Re: alpha numbers Message-ID: <3708@wn1.sci.kun.nl> Date: 26 Jun 91 14:20:37 GMT Article-I.D.: wn1.3708 References: <1991Jun23.200134.18835@pronto.mh.nl> <1991Jun24.231628.14446@jpl-devvax.jpl.nasa.gov> <1991Jun25.134732.1668@pronto.mh.nl> Sender: root@sci.kun.nl Organization: University of Nijmegen, The Netherlands Lines: 26 In <1991Jun25.134732.1668@pronto.mh.nl> jv@mh.nl (Johan Vromans) writes: >(Tom Christiansen) writes: >| Okay, tell me the correct value for this: >| >| $a = "1e0"; >| $a++; >If $a is a valid number, use aritmetic. Otherwise, treat it as a string >and use magical increment. Are you sure you want this? Consider: $a="1d8"; print ++$a; # prints 1d9 print ++$a; # prints 1e0 print ++$a; # prints 2, since $a is now numeric. Magical increment, indeed. -- $level="novice"; ++$level; ++$level; ++$level; print "Just another Perl $level," Hans Mulder hansm@cs.kun.nl