in reply to get a reference implicitly within a subroutine call?
The elements of @_ are all aliases to the original arguments, so if they are lvalues they can be modified.
That will not work for constant arguments,sub strip_space { s/\s//g for @_; 1; } my $test = "this will have no spaces!"; strip_space($test); print $test,$/; __END__ thiswillhavenospaces!
# strip_space("this will have no spaces!"); # modification of constant error
After Compline,
Zaxo
|
|---|