title: What does Perl return from a subroutine when no return statement is encountered?
body: <p><em>I encountered this today and thought it prudent to post a Q&amp;A as I couldn't find anything similar.<br>
  Feel free to vote-to-close if you find a duplicate of this question.</em></p>
  
  <hr>
  
  <p>The following subroutine conditionally <a href="http://perldoc.perl.org/functions/return.html" rel="nofollow noreferrer"><code>return</code></a>s output; I consider it "clumsy" because it isn't explicit about what is returned to the caller when the conditional is not satisfied:</p>
  
  <pre><code>sub is_multiple_of_three {
  
      my ( $value ) = @_ ;
      return "$value is a multiple of 3"
        unless $value % 3;
  }
  </code></pre>
  
  <p>A quick rewrite makes short work of clarifying the (more graceful) subroutine's intended behaviour under all circumstances:</p>
  
  <pre><code>sub is_multiple_of_three { 
  
      my ( $value ) = @_ ;
      return if $value % 3;
      return "$value is a multiple of 3";
  }
  </code></pre>
  
  <p>When calling these both flavours of the subroutine, I was expecting to find some consistency between what both <code>return</code> in list context:</p>
  
  <ul>
  <li>a string when the conditional evaluates to true</li>
  <li>nothing (an empty list) when the conditional evaluates to false</li>
  </ul>
  
  <p>But alas, the behaviour was slightly unexpected:</p>
  
  
  
  <pre><code>use strict;
  use warnings;
  use Data::Printer;
  use feature 'say';
  
  my %subs = (
              graceful =&gt; sub {
                              my ( $value ) = @_ ;
                              return if $value % 3;
                              return "$value is a multiple of 3";
                          },
  
                clumsy =&gt; sub {
                              my ( $value ) = @_ ;
                              return "$value is a multiple of 3"
                                unless $value % 3;
                          },
             );
  
  for my $name ( keys %subs ) {
  
      my $sub = $subs{$name};
      say $name;
      my @results = map { $sub-&gt;($_) } 1 .. 10;
      p @results;
  }
  </code></pre>
  
  <p><strong><em>Output</em></strong></p>
  
  <pre><code>graceful
  [
      [0] "3 is a multiple of 3",
      [1] "6 is a multiple of 3",
      [2] "9 is a multiple of 3"
  ]
  clumsy
  [
      [0] 1,
      [1] 2,
      [2] "3 is a multiple of 3",
      [3] 1,
      [4] 2,
      [5] "6 is a multiple of 3",
      [6] 1,
      [7] 2,
      [8] "9 is a multiple of 3",
      [9] 1
  ]
  </code></pre>
  
  <p><strong><em>Question</em></strong></p>
  
  <p>The "graceful" flavour behaves as expected, but why is the "clumsy" sub returning back integers when the conditional is false?</p>