Programming-Idioms

History of Idiom 3 > diff from v22 to v23

Edit summary for version 23 :
[Perl] Old version returned value, text said not to do so

Version 22

Version 23

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

Code
sub myProcedureName {
    # Get subroutine arguments
    my ($arg1, $arg2, @rest) = @_;

    # do stuff
    return $result;
}
Code
sub myProcedureName {
    # Get subroutine arguments
    my ($arg1, $arg2, @rest) = @_;
    # do stuff
}