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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Trying to avoid line noise (brain cramp)
by Ovid (Cardinal) on Mar 09, 2001 at 18:45 UTC | |
by clemburg (Curate) on Mar 09, 2001 at 18:47 UTC | |
by frag (Hermit) on Mar 09, 2001 at 20:51 UTC | |
|
Re: Re: Trying to avoid line noise (brain cramp)
by BrotherAde (Pilgrim) on Mar 09, 2001 at 18:53 UTC |