http://www.perlmonks.org?node_id=346109


in reply to Re: Re: Re: Why do we say the =~ operator "binds"?
in thread Why do we say the =~ operator "binds"?

I just grepped my source repository to see where I'd written that and I couldn't find it. The general case I'd thought of where it was annoying or inconvenient to the narrative to give the topicalized variable a name. I can't find an example (though I did just find a code-typo in Switch.pm where ~= was said instead of =~).

for ( ... ) { $foo = /.../; }

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Why do we say the =~ operator "binds"?
by William G. Davis (Friar) on Apr 18, 2004 at 22:11 UTC

    It's *almost never* annoying or inconvenient to the narrative to give topicalized variables names.

    The loop is the discussion and the alias variable is what's being talked about. It's the topic--the subject--and it has a name, even if you don't feel like giving it one. And using "for" when you really mean "foreach" element in some list doesn't help anyone either (again, when the code's for public consumption, not when it's just for you.)