in reply to Weird eval behavior...

Fletch gave you the best advice but didn't spell it out. Check the value of $@ after eval(). If $@ is true, the eval() failed and printing $@ will give you the exception message.

You should always check $@ after eval'ing code, unless you just don't care about the outcome, in which case you might as well just delete the eval. (:

conv

Update: for what it's worth, when you print $@, it will probably contain a complaint about a bareword, because after interpolation, you're passing a bareword to your sub. Using qq// and placing quotes around $_ in the sub argument probably fixes your code.