You also asked (in a message, but the answer is way to lengthy for the peephole messages force you to use):
Perhaps I fail to understand your question. My comment predicated on the fact that if a vowel is absent, continuation is moot. Not so?
Let me explain the sequence of events:
- varghees asks the original question how to write a regexp matching all five vowels.
- SuicideJunkie gives the obvious answer, the "anded if".
- leuchuk replies to SuicideJunkie, saying he wouldn't use the "anded if" solution, but an array based on because As soon as the script has found the first vowel the script would continue with the next vowel but if the vowel wasn't found it would stop the whole search as it's not interesting whether the other vowels are in the string.
- I ask leuchuk why he'd choose that solution over the "anded if", as the "anded if" also gives that benefit (you, know, short-circuiting logic operators) -- but leuchuk seems to suggest that it doesn't.
- You reply to me with If the first is not found, you're done, per OP's spec: "all 5 vowels". Noone in this sequence of posts leading up to yours has giving even the most remote inkling that he was thinking it was about anything else but matching all 5 vowels.
So, let me repeat my question, how does your reply to me answer the question why doesn't an "anded if" stop if a vowel isn't found? It's not that what you say is wrong, it's just that you're stating something irrelevant as it doesn't even try to answer the question.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|