in reply to technique of push
Operators define their own parsing rules. Some of these can be approximated using prototypes.
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: technique of push
by saranperl (Initiate) on Sep 02, 2009 at 07:14 UTC | |
by ikegami (Patriarch) on Sep 02, 2009 at 07:22 UTC |