http://www.perlmonks.org?node_id=63245


in reply to Trying to avoid line noise (brain cramp)

Avoiding line noise in Perl is mainly about how to handle regexes, IMHO.

A good tip here is to use variables in the regexes:

# original: /([^(]+)(\([^)]+\))(.*)/ my $not_paren = "[^(]+"; my $paren = "\\("; my $rest = ".*"; # now reads: $string =~ /($not_paren)($paren$not_paren$paren)($rest)/;

This will do a good job to make the code readable to other programmers, in my experience.

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com