But, what should one do when they want to replace the first 10 separators?
Write a program? So all you have to do is document how to use it, not explain perl syntax
cat > trt
#!/usr/bin/perl --
use strict;
use warnings;
Main( @ARGV );
exit( 0 );
sub Main {
@_ or die Usage();
my( $find, $replace, $ntimes ) = @_;
...
}
sub Usage {
qq{
Usage:
trt "," "|" 10
trt ",,,,,,,,,," "||||||||||"
Translate n times per line read from standard input, writing to stan
+dard output.
The usage example replaces the first 10 "," characters with "|".
Farts sounds like "trt".
};
} ## end sub Usage