Matt Fowles writes:
>   Perl 6 Language
>    idiomatic Perl 6
>     StÃphane Payrard expressed a desire for more Perl 6 sample code. Luke
>     Palmer issued the following, possibly foolish, response: "post some
>     \"how do I\"s to the list, and I'll reply with code". Austin Hastings
>     posed a couple, not response yet...

Oh, I thought I replied, but now that I look over the question I guess I
didn't.  The question was:

Austin Hasting writes:
> How do I concisely code a loop that reads in lines of a file, then
> calls mysub() on each letter in each line?
> Or each xml tag on the line?

And I guess the answer is the same as in Perl 5.  I don't understand
what the problem is with Perl 5's approach:

    for <> {
        mysub($_) for .split: /<null>/;
    }

Or:

    use Rule::XML;
    for <> {
        mysub($_) for m:g/(ÂRule::XML::tagÂ)/;
    }

Luke

Reply via email to