[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [5.1.4] "attempt to index global 'data' (a nil value)
- From: Gilles Ganault <gilles.ganault@...>
- Date: Sun, 24 Jul 2011 14:56:24 +0200
Hello
Using a Lua script on XP, I need to open an HTML file and extract
hyperlinks...
===========
data = io.open("C:\places.txt","r")
for line in data:lines() do
for token in string.gmatch(line, '<a
href="(/places/.+?\.php)">') do
print(token)
end
end
data:close()
===========
... but it fails with the following error message:
===========
lua5.1.exe: places.lua:2: attempt to index global 'data' (a nil value)
===========
Any idea what is wrong with the above?
Thank you.