\documentclass{article}
\usepackage{perltex}
\newcommand{\asts}{}
\perlnewcommand{\astsperl}[1]{'\renewcommand{\asts}{'. '*' x $_[0] . '}'}
\begin{document}
  \astsperl{10000}\asts
\end{document}