in reply to generating a list of identical elements

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

Replies are listed 'Best First'.
Re^2: generating a list of identical elements
by AnomalousMonk (Archbishop) on Jan 19, 2011 at 11:41 UTC
Re^2: generating a list of identical elements
by rovf (Priest) on Jan 19, 2011 at 11:48 UTC

    Great!!! I had not expected this possibility, so I did not look up the definition of this operator. My fault, and thank you for telling me!

    -- 
    Ronald Fischer <ynnor@mm.st>

      In Perl, the slogan could be "There's an op for that." ...but someone would probably get sued...

      --Ray