package App::InteractivePerlTutorial::Chapter::Sub::Returning;

use 5.014000;
use strict;
use warnings;
our $VERSION = '0.000_001';

use constant TEXT => 'Basic Output';

1;
__DATA__

=encoding utf-8

=head1 Returning

You can force a subroutine to return a variable by using the command B<return>. When you use it the subroutine stops.

  sub add_1_to_x {
    return $x+1;   #returns x+1
    $x=$x+2           #doesn't do anything
  }

You can also return other types of variables like arrays:

  sub return_1_2_3 {
     return qw(1 2 3);
  }

  my @a=return_1_2_3;
  say @a; # says 123;


=cut
