sub myfunction_long { my $z = $_[0] + $_[1]; # add the first 2 parameters and assign result to $z return $z; } sub myfunction_medium { my $z = $_[0] + $_[1]; # add the first 2 parameters and assign result to $z } # value of $z implicitly returned sub myfunction_short { $_[0] + $_[1]; # add the first 2 parameters } # result of expression implicitly returned print myfunction_long(1, 2); # prints 3 print myfunction_medium(1, 2); # prints 3 print myfunction_short(1, 2); # prints 3