in reply to Repeating a substitution

perl -pe 's/,/|/ for ($_) x 10'

Too obscure. This is of the types of constructs which, while being clever, earn perl the fame of being unreadable. There's way too much knowledge needed for a casual programmer to get things right.

I wouldn't use a statement modifier in this case, but a loop which uses another variable as loop variable:

perl -pe 'BEGIN {$n=shift} for my $c (1.. $n){ s/;/|/ }' 10 $files

edit: the two things to grasp here are

  1. what a BEGIN block is about (good to know)
  2. omitting the my $c would make the implicit loop $_ mask the outer $_
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'