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


in reply to Flag variables

Problems. Poor locality of reference. Possibility that the value you set and check are unrelated. Meaningless variable name making it hard to know what the flag means - people often write code thinking the flag means X when it is true, and then slip up and treat it as NOT X instead.

Not all flags are bad. But make the flag's name a yes/no question which its value is the answer to (avoiding reversing its meaning), and don't use a flag where an alternative suggests itself.

Additional misfeature in your code. The &foo notation passes implicit arguments which is often not desired. As perlsub says, This is an efficiency mechanism that new users may wish to avoid. *ahem* Experienced users as well. :-)