in reply to Re^3: foreach loop and creating files with "$_"
in thread foreach loop and creating files with "$_"

That is simply one of Perl's restrictions. You can talk about several things at once, but you will have to name them explicity, rather than referring to all of as "this" and "that". At least you get one such pronoun, though; that's one more than in pretty much every other language out there.

Given that programs aren't actually conversations, I don't think it's a terribly bothersome restriction either. In practice, programs more closely resemble instructions, recipes, that sort of thing. There's usually one thing you're working on at any given time; often it's referred to as "it", and (in recipes in particular), it's also often not explicitely referred to at all ("cook until tender" etc).

I think the parallel to $_ is obvious.

  • Comment on Re^4: foreach loop and creating files with "$_"