duplicateAttr script won't work for me

I don't get it... the script says-

// Description:
// This procedure duplicates attrs from the source node to the destination
// node.
//
// Input Arguments:
// string $objList[]: list of objects - source first, destination second
// string $attrList[]: list of attrs to copy
//

this is my code and I keep getting 'wrong number of arguments..' or syntax error...

select $AA $BB ; string $objList[] = ls -sl;

string $attrList[] = listAttr -ud $AA ;

duplicateAttr ($objList, $attrList) ;

cheers, -M

I hacked the script, and got to do a better duplicate (+connect+etc) on a per attr basis... nonetheless, I wouldn't mind knowing how the script's suppose to work or what's with my syntax... -M