-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I must say that since joining this list I have had many days brightened by yet
another cool piece of code. The neat-o meter gets pegged almost everyday.
:-)
On Thursday 05 June 2003 12:49, Jenda Krynicky wrote:
> From: Kevin Pfeiffer <[EMAIL PROTECTED]>
>
> > In keeping with my feeling that with 'map' one can do almost anything
>
> quite right, but
>
> > (if I knew how) I'm happy to have managed to build something using
> > 'map' (without external help I mean). Seems easy, now. ;-)
> >
> > # months into numbers...
> >
> > $month = "Jan" # for example
> >
> > my %m2n;
> > my $x = "00";
> >
> > map { $m2n{$_} = ++$x } qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov
> > Dec);
>
> you should not use map{}() in void context. map{}() is supposed to
> create a list, in this case you are not creating any. You are just
> looping through a list. You should use for/foreach for that:
>
> $m2n{$_} = ++$x
> for qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
>
> But the idea was good :-)
>
> Jenda
> ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
> -- Terry Pratchett in Sourcery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE+34OUkXvEbfjFKqoRAjpCAJsGYHgWmKksDGRPNDNiLf6zeK9BfACgqBj1
hqFj1kDvod0T8WDpk7UfH48=
=t+w9
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]