in reply to When in the course of Perl topicalizers

Is a for loop not a sufficiently good topicalizer?

It doesn't use or change any variables, so it doesn't make a good topicaliser at all.

The documentation says you can use a foreach loop instead of given, and it doesn't mention you can use a C-style for loop (which is closer to a while loop than anything else) instead of given.

Replies are listed 'Best First'.
Re^2: When in the course of Perl topicalizers
by piezocuttlefish (Initiate) on Jul 07, 2010 at 01:13 UTC
    Bummer. I think I get it. foreach and given always change the topic, whereas for and while aren't topicalizers; Perl just is nice and replaces <> with defined ($_ = <>).