in reply to question on regexp:
I'll start with...
$all = ~s/[.|]+/|/g;
Have a look at perlop for details, but ~ is bitwise negation (so ~1 is 4_294_967_294). The s/// operator returns the number of replacements done, so that's what the ~ would be operating on. This is what happens:
The $all =~ s/[.|]+/|/g; syntax is one I'm guessing you're familiar with. In that case, the substitution is done on the variable $all.
Update: Oops, I answered the wrong question.
|
|---|