in reply to Re^2: understanding closures
in thread understanding closures
The ++ operator (see perlop) first retrieves the current value and then increments the value when used as post-increment.#!/usr/bin/perl use strict; use warnings; my $cnt = 0; print $cnt++, "\n"; print $cnt++, "\n"; print $cnt += 10, "\n"; print $cnt++, "\n"; print $cnt++, "\n";
Cheers - L~R
|
|---|