At 11:11 PM +0000 5/5/05, Terrence Brannon wrote:
Luke Palmer <[EMAIL PROTECTED]> writes:
 > On 5/5/05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
 I was looking at a line in the hangman program:

   @letters == @solution.grep:{ $_ ne '' };

and was told that I was looking at an adverbial block.

The adverbial block is what you're giving to `if` when you say:

if $foo { ... }

It is? An adverb describes a verb. What is the verb here?

In the above example, the 'grep' is the verb. Various operators like 'grep', 'map', 'sort' etc are all verbs or action words, they say to *do* something.


By default, every verb has a default action; sort's default is to use 'cmp', map's default is to pass each value unchanged, grep's default is to pass every value whose truth value is 'true'.

The adverbial block lets you customize the verb and change its behaviour.

This is how I understand adverbs.

It's a very good system and should be used.

-- Darren Duncan

Reply via email to