in reply to Re: Using ternary operator as lvalue in pushin thread Using ternary operator as lvalue in push
i would like to spend more words on why push is prototyped So we don't have to pass a reference for the first argument. If there weren't a prototype, the array being passed in would be flattened: push @array, $value; would be equivalent to: push $array[0], @array[1..$#array], $value; Let's compare two subroutines with and without prototypes, and see what's in @_: Read more... (813 Bytes)
So we don't have to pass a reference for the first argument.
If there weren't a prototype, the array being passed in would be flattened:
would be equivalent to:
Let's compare two subroutines with and without prototypes, and see what's in @_: