temporal has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
I was perusing Meditations, as I am wont to do on a Friday afternoon. I stumbled upon Don’t Repeat Your… version number. It's probably because my brain is already off for the weekend, but I can't seem to wrap my head around the code:
my %const = map { s/\s+//; $_ } map { split /\s*=>\s*/ } grep { /=>/ } map { split /\n/ } << '=cut'; =pod This module uses the following constants: bang_eth => 1 biff => 2 krunch => 3 =cut
I don't do a lot of POD, so I'm pretty lost. I can discern that the code is parsing something that looks like the POD at the end, grabbing the key/value pairs and putting them into a hash. Can anyone shed some (step-by-stepish) light on this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: POD Meditation?
by JavaFan (Canon) on Apr 27, 2012 at 20:40 UTC | |
by temporal (Pilgrim) on Apr 27, 2012 at 20:58 UTC | |
by JavaFan (Canon) on Apr 27, 2012 at 21:05 UTC | |
by LanX (Saint) on Apr 28, 2012 at 12:47 UTC | |
by JavaFan (Canon) on Apr 28, 2012 at 17:07 UTC | |
|