Re: This Week on perl5-porters (10-16 March 2003)
[email protected] (Abigail) Tue, 18 Mar 2003 00:27:46 +0100
| Newsgroups | perl.perl5.porters,perl.perl5.summary |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Mar 17, 2003 at 11:21:18PM +0100, Rafael Garcia-Suarez wrote:
>
> Hugo asks why the one-liner :
>
> perl -le 'print $a++'
>
> prints "0". Abigail doesn't find this behavior strange, and (as
> expected) has "written code that depends on this". The discussion
> continues.
>
Just to avoid people getting the impression I went out of my way
to make use of this behaviour, here's a simple example:
my $i;
my %months = map {$_ => $i ++} qw /Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec/;
Abigail