lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


How does one do the equivalent of
the following Perl code:

($name,$birthyear,$sex) = split();

when presented with a line of input text like:

"jane 2000 f"

which results in $name = "jane", $birthyear = 2000, $sex = "f"

in Lua 5.0?

I'm learning Lua with the aim to use it as a stand-alone 
scripting language. I don't have any plans to embed it in anything
at the moment and want to avoid linking in C code if possible.