[help]how to write a script to get all the sequences from hundreds of PDB files?

Hi,
I am using DS2.0 and want to get get all the sequences from hundreds of PDB files, however, the following scripts do not work. Where is the bug? How to define the \\\$molecule? Thanks very much!

use strict;

use MdmdiscoveryScript;
my \\\$document=DiscoveryScript::ActiveDocument();
my \\\$sequence = \\\$document->CreateSequenceFromMolecule(\\\$molecule, true);