Freesnöw
Freesnöw

Reputation: 32133

Understanding this Lua snippit

I've got this bit of code here:

local http = require("socket.http")

I know it's supposed to allow me to use some stuff from somewhere else but I have a couple of questions.

Where does it expect to find "socket.http"? What should it expect? A DLL? A Lua script? Both?

Upvotes: 2

Views: 126

Answers (1)

lhf
lhf

Reputation: 72312

require can load both DLLs and libraries written in Lua. It looks for them using package.path and package.cpath, in that order. For details, see the Lua reference manual.

Upvotes: 5

Related Questions