I don't use perl much (at all)

But I do think you've got it right there, nebulus200..

I remember having a little thinko in one of my bash scripts where indeed the $? didn't mean what I expected...