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