Re: Any problem with using env variables instead of globals?

Scott Raney (raney@metacard.com)
Wed, 17 May 1995 15:20:48 -0600 (MDT)

>
> Because its more convenient, I've started using env vars instead of MC
> globals in my scripts. Are there any problems with this approach?
> (eg. I do things like: put "my_command a b c" into $cmd_line", then
> invoke a process communication stack that does: "open $cmd_line for
> update")
>
> Stop me before I sin. :-)

I don't see any problem doing this other than the fact that it might
be confusing to people not familiar with the technique. Performance
is only slightly (1%) worse setting the environment variables vs the
regular globals. The exception is the case where the script performs
a series of mathematical operations on a variable, in which case using
an environment variable will make the series run at about 50% of
normal speed since it causes the number-to-string conversion to be
done after each operation, a conversion that doesn't happen with
regular globals until you actually access them as a string.

> -sp-

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney@metacard.com                   the more you'll see -- Lidia   *
***********************************************************************