import org.perl.*;

Collection foo = Perl5.unpack(template, string);