Terry Michaels wrote:
> If I might ask, what exactly is the line
>   strings = *strings
> doing?
> For that matter, I could use a little more clarification on what the '*' 
> (glob?) operator does...

It's not really a normal operator, rather it's part of Ruby's syntax
that happens to look like an operator, and in some cases operates like
one. It's often called the splat operator because it looks like a
squashed bug ;-). It means different things in different contexts.

Preceding the last parameter in a method's parameter list (excluding &,
which is also special), it says that any parameters passed in addition
to any previously declared, should be passed as an array to this parameter.
This is how Ruby handles methods with a variable number of parameters.

In an assignment statement, it says "expand this array and do a multi
assignment". If the value is not an array, it continues to act like a
single assignment... and that's the magic I'm using in my example.

On the left-hand-side, this multi-assignment has only one receiver, which
again is a special case, like the reverse of splat. It joins all the
values being assigned into an array and assigns that value. So,

strings = *strings

is a way to array-ise something that might or might not be an array.

Just a final note on multi-assignment, if there is a comma-separated
list on the left, possibly ending with a comma, only the respective
values are assigned and the rest are discarded. So these are equivalent:

a, = *strings
a = strings[0]

and so are these:

a, b = *strings
a, b = strings[0], strings[1]

The final thing you might want to do is:

a, b, *c = *strings

Umm, try it, you'll figure out what it's doing. Like calling a splat method.

This is just a magic part of Ruby's syntax, mostly useful for confusing
newbies and making your code unreadable except by wizards ;-).

Clifford Heath.