<div dir="ltr">I would not use smartmatch operator if it can be avoided:<div><a href="http://blogs.perl.org/users/brian_d_foy/2011/07/rethinking-smart-matching.html">http://blogs.perl.org/users/brian_d_foy/2011/07/rethinking-smart-matching.html</a><br>
</div><div><br></div><div>I think grep does the same thing just as easily.  Haven't checked speed though.</div><div><br></div><div>/bda</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Jul 8, 2014 at 1:38 PM, Mark Senn <span dir="ltr"><<a href="mailto:mark@purdue.edu" target="_blank">mark@purdue.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thought you might be interested in a little<br>
test file I put together to test that Perl 5.20<br>
works...at least on a tiny bit of the stuff it<br>
can do.  Source code is the rest of this message.    ---Mark Senn<br>
<br>
#!/usr/new/bin/perl<br>
<br>
use Modern::Perl;<br>
<br>
use experimental qw 'signatures smartmatch';<br>
<br>
use feature 'say';<br>
<br>
my $option = undef;<br>
$option // say 'it was undef';<br>
<br>
$option = 0;<br>
$option // say 'it was zero';<br>
<br>
sub a ($a) {<br>
    return $a;<br>
}<br>
<br>
sub b($x,$y){<br>
    return $x+$y;<br>
}<br>
<br>
sub c ($one, $two, $three)<br>
{<br>
    return $one + $two + $three;<br>
}<br>
<br>
my $x = a(2);<br>
say $x;<br>
<br>
my $y = b(3,4);<br>
say $y;<br>
<br>
say c(5,6,7);<br>
<br>
# I usually go without parentheses is sub calls.<br>
say c 5, 6, 7;<br>
<br>
my @msee130 = ('Mark', 'Curtis', 'Rich', 'Mike', 'George', 'Joe');<br>
<br>
my $name = 'Fred';<br>
<br>
$name ~~ @msee130  or  say "$name is not here";<br>
<br>
# I like to set off conditions at the beginning of a line with ( ... ).<br>
($name ~~ @msee130)  or  say "$name is not here";<br>
_______________________________________________<br>
Purdue-pm mailing list<br>
<a href="mailto:Purdue-pm@pm.org">Purdue-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/purdue-pm" target="_blank">http://mail.pm.org/mailman/listinfo/purdue-pm</a><br>
</blockquote></div><br></div>