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

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

Thread Previous | Thread Next
March 17, 2003 15:28
Re: This Week on perl5-porters (10-16 March 2003)
Message ID:
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/;


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About