You can do this with the x operator as well:
perl -e '$x="ab"; $n= 20; @f= ($x) x $n; print join "|",@f;' #prints ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab|ab
In reply to Re: generating a list of identical elements
by jethro
in thread generating a list of identical elements
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |