I think Net::FTP uses $@ for its error messages (whether that's good or bad is out of the scope of this post). $! would not make sense, as most of the errors you would get out of Net::FTP do not map to standardized system error messages/numbers, thus would be unsuitable for $!.