note
Juerd
<p><blockquote><em>As I understand it, these options will all effectively be turned on by default in the Perl 6 regex engine. So either Larry has decided that they are, in fact, best practice or Damian has sneaked them into the specs whilst Larry wasn't watching.
</em></blockquote></p>
<p>
Firstly, Perl 6 is not Perl 5.
</p>
<p>
Secondly, Perl 6 gives you <tt>\N</tt>, a convenient way to write <tt><-[\n]></tt> (that's <tt>[^\n]</tt>). It's worse than <tt>.</tt>, but acceptable. Writing <tt>[^\n]</tt> all the time is a hard exercise for one's fingers, and makes for messy code. That's why I strongly believe you should only use <tt>/s</tt> when you really want <tt>.</tt> to include the newline character.
</p>
<p>
<tt>/m</tt> won't be turned on by default in Perl 6. Instead, we get different metacharacters for begin/end of line versus string. So again it gives best of BOTH worlds.
</p>
<p>
As for <tt>/x</tt>... I have no strong opinion about that. I don't think <tt>/\A\d+\z/</tt> is unreadable, but I don't mind <tt>/\A \d+ \z/x</tt> at all.
</p>
<div class="pmsig"><div class="pmsig-132236">
<p><font color="#800000">
Juerd
# { site => '<a href="http://juerd.nl/" target="_blank"><font color="#800000">juerd.nl</font></a>', do_not_use => '<a href="mailto:spamcollector_perlmonks@juerd.nl" target="_blank"><font color="#800000">spamtrap</font></a>', perl6_server => '<a href="http://feather.perl6.nl/"><font color="#800000">feather</font></a>' }</font></p>
</font></p>
</div></div>
556406
556410