<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid:20071220072657.GB8107@taz.net.au" type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">only if they can't read perl.
</pre>
</blockquote>
<pre wrap="">nobody can read Perl... :)
</pre>
</blockquote>
<pre wrap="">lots of people can. it's kind of a requirement for writing it well.
</pre>
</blockquote>
whoosh....<br>
<blockquote cite="mid:20071220072657.GB8107@taz.net.au" type="cite">
<blockquote type="cite">
<pre wrap="">except that using your http example, you can't parse url arguments
(without escaping)
</pre>
</blockquote>
<pre wrap=""><!---->
1. i wouldn't. using regexps to parse CGI args is a bad idea. that's
what CGI or any one of several other CGI arg parsing modules are for.
</pre>
</blockquote>
obviously - but since you brought up the example, you cant then turn
around and point fingers...<br>
<blockquote cite="mid:20071220072657.GB8107@taz.net.au" type="cite">
<pre wrap="">2. for the sake of the argument, if i were to be writing a Q&D hack
to do that, i would (as i mentioned in my previous msg) use another
separator. '|', perhaps. or maybe '-'. or something.
depends. my personal aesthetic says if i have to escape a character
more than once or twice then use a different separator.
</pre>
<blockquote type="cite">
<pre wrap="">and the ugliness-factor would but much worse. Perl
POD often uses '!'... maybe that is a good character to use?
</pre>
</blockquote>
<pre wrap=""><!---->or '!', even if it does feel a bit over-excited. B1FF-mode regexps.
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Use curly braces instead:
</pre>
</blockquote>
<pre wrap="">i find that ugly inside regexps, and don't/won't do it. curly braces
are for hashes or code blocks etc, not for uglifying regexps.
i'll use pretty nearly anything else before i'll use them.
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->also, curly braces have a meaning inside regexps - they're for
specifying the number of times to match.
{n}? Match exactly n times
{n,}? Match at least n times
{n,m}? Match at least n but not more than m times
i use them all the time, especially the latter two forms.
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">YMMV, but to me, that is significantly less readable.
</pre>
</blockquote>
<pre wrap="">The POD contains many references where using balanced brackets is a
good thing - it would be only you that considers them ugly.
</pre>
</blockquote>
<pre wrap=""><!---->
1. what can i say? i have good taste where some others don't :-)
(and i don't consider all curly braces ugly - just using them as regexp
boundaries)
2. POD has such examples inside regexps?
</pre>
</blockquote>
perlre has examples using {} <>, perlop uses {}<br>
<br>
And if you consider the 'tr' operator in a similar vein, perlop uses []
<> {}<br>
<br>
perlop even has one example where two different brackets are used in
the same operation, as in:<br>
<br>
$program =~ s {<br>
...<br>
} []sgx;<br>
<br>
<br>
Mathew
</body>
</html>