sub my_push(\@@) { my $ref = shift; push @$ref, @_; return 0+@$ref; } my @a = (1..4); my_push(@a, 5); print "@a\n"; # 1 2 3 4 5