Except as loop indices or as part of mathematical functions such as if ($x^2 + $y^2 == $z^2) { ... }. And, useless variables are only useless outside of context. %data might be perfectly acceptable in a properly-named function.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?