sub getVersion { return $http->sendCommand('version'); } #### $device->getVersion(); //This is called through device object rather than connection object. #### sub AUTOLOAD { my $connection = $device->getConnection(); return $connection->$methodName (..); // when called for getVersion, $methodName will become the "getVersion" }