in reply to for ($@)

If you change the for() to if() you'll cange the semantics. As $@ is always one scalar value (just like all scalar variables) the for($@) will always be executed once, regardless of the value of $@. So
for ($@) { print $@; }
is the same as:
print $@;
But I'd say the original semantics was wrong, so you'd better use the if(). I'd even suggest you use if (my $e = $@) {... to get rid of some nasty side-effects like $@ getting cleared by some sub you call inside your if-block...

Search, Ask, Know