awk - Pre-populating an array from system command output

So, here's a scenario that requires the same logic as what I'm working on: Suppose that you have a directory containing files named after users. For awk's purposes, the filename is a single field-- something parse-friendly, like john_smith. Now, let's say that I'd like to populate an array in this sort of fashion:

filesize[filename] = $5

That is, the element of the array filesize whose index is the filename will contain that file's size. That's very straightforward if that's all I want to do, but naturally I can't just leave well enough alone. What I'd like to do is be able to do is read in a file (say, a .csv) which has a name field that can be used to recall the file size from the array I just populated. Naturally, there would be other operations going on as well; this is just one element of a larger task. So here's the flow I'm picturing:

1) BEGIN: Execute the command 'ls -al', assigning: filesize[$9] = $5 (give or take, depending on your version of ls...)
2) Perform processing, on a piped stream or file given as an argument, in which filesize[filename] can be recalled as needed.

Here's something that doesn't work...

#!/usr/bin/awk -f

BEGIN   {
        while ((getline system("ls -al"))
        filesize[$9] = $5
        }

        {
        print "The size of the file " $0 " is " filesize[$0]
        }

If we call that "analyze.awk" and run:

echo "john_smith" | ./analyze.awk

I would expect output like, "The size of the file john_smith is 12395". Of course, I'm here for help, so it doesn't work:

/usr/bin/awk: syntax error at source line 5 source file ./analyze.awk
 context is
                while ((getline system("ls -al")) >>>
 <<<
/usr/bin/awk: illegal statement at source line 5 source file ./analyze.awk

I strongly suspect that I don't yet really get how getline works. Any ideas how to do this? Many thanks in advance.

Instead of:

... try:

while ("ls -al" | getline)

Regards,
Alister

Oh, that's excellent. That is to say, it actually works! Many thanks. Now, I'm off to learn a bit more about getline. I see now that the 'system' bit is simply the exit status of the command, not the output of the command itself; not very useful in this context.

Again, thanks for the help.