In article <[EMAIL PROTECTED]>, Larry Wall

> On Thu, Apr 12, 2007 at 01:52:50PM -0500, brian d foy wrote:

> : Here's my code example that motivates this question. For a Llama6
> : exercise with file test operators, I wanted to create a little table:
> : 
> :    for @files -> $file {
> :       printf "%-70s  %s  %s  %s\n",
> :          $file,

> I think I would now write that more like:
>     for @files -> $file {
>  given stat $file {
>    printf "%-70s  %s  %s  %s\n", $file, .:r, .:w, .:x;      
>  }
>     }

Hmmm, that's a good little bit of code, as was Damian's use of the
hyper-operator. The trick is to figure how how much I can use in Llama
6 without scaring off the reader. :)

I'm actually starting at the back of the book so I know what I have to
put in the front of the book to get that far. In previous Llamas the
file tests operators came before stat, but maybe this answer is a good
end-of-chapter sorta thing.

I'll also have to think about using given {} merely as a topicalizer
too, I guess, although showing it next to an explicit assignment to $_.


Reply via email to