lua-users home
lua-l archive

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


Yeah, I've sure done it a bunch of times, myself - I've been doing
this stuff since the late 70's, so I should know better by now...

I'm learning Lua, rather than doing this project in Perl or Python,
because it seems like the perfect tool for a scripted agent to run on
servers to monitor for problems, run backups, etc.: very fast, small,
and easy to deploy standalone. (Though, from what little
experimentation I've done, I'm probably going to be asking questions
about that before long...)

Thanks for the suggestion.  I had a single typo (pardon the pun) where
I left a prefix off the variable "schtype".  Vim even highlighted it
for me to tell me it was a no-no, but I missed that, too.

Actually, Lua is at least partly to blame for it taking me so long to
find the problem: I wasn't expecting the error message to be that
descriptive or informative. I'll pay a little more attention next time...

Thanks again,

Mark

Wednesday, August 8, 2012, 10:18:04 AM, you wrote:

> On Wed, Aug 8, 2012 at 3:58 PM,  <mchalkley@mail.com> wrote:
>> I sure wish I'd asked the question 4 hours ago...

> Don't worry, we've all done things like that. Eventually through pain
> and experience we learn that handful of global functions by heart and
> avoid them as variables.

> There are some defensive strategies.  Some people start off their
> modules like this:

> local G = _G

> (_G is another global, and just refers to the global table itself, so
> type == _G["type"])

> And then it's G.type, G.print, and so forth.  Then your variables
> won't collide with them!

> steve d.