in reply to use of typeglob aliases
@_ is an alias for the arguments sent, and the foreach loop makes $element an alias for each element of @_ in turn, so this works out and is reasonably clearer.@array = (10,20); Double(@array); print "@array"; sub Double { foreach my $element (@_) { $element *=2; } }
|
|---|