in reply to RE: Re: require problems
in thread require problems

lists in scalar/boolean context return the number of their elements.
Oh. Once again, trying to dispel the myth of that statement. Repeat after me: Now, what's really happening is that you have a list assignment operator in a scalar context, which is defined as having a return value of the number of elements copied across, while giving a list context to the right side.

In this case, the right side is a simple expression, which gets turned into a list of one element. So we get a "1" for the return value.

Once more, just so you remember:

-- Randal L. Schwartz, Perl hacker

  • Comment on NEVER a list in a scalar context -- PLEASE!