[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Puzzle - Temp file creation



On Mon, Jul 12, 1999 at 11:58:50PM +0100, Adam Sampson wrote:
> Second, since when has "aaaa"++ been "aaab"?

Since perl4 or earlier.


> 	azz@cartman$ perl
> 	$a = "aaaa"; print $a; print $a++;
> 	aaaaaaaa

$a++ is post-increment.  If you want to examine the value of $a _after_ the
operation, use pre-increment instead (or put the increment in a separate
statement.)

perl
$a = "aaaa"; print $a; print ++$a;
aaaaaaab

Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe