develooper Front page | perl.perl5.porters | Postings from March 2003

Re: This Week on perl5-porters (10-16 March 2003)

Thread Previous | Thread Next
From:
Abigail
Date:
March 17, 2003 15:28
Subject:
Re: This Week on perl5-porters (10-16 March 2003)
Message ID:
20030317232746.GH25751@abigail.nl
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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About