in reply to how to self define a operator
DB<11> sub op { $_[0] += $_[1] } DB<12> $x=4 DB<13> op($x,5) DB<14> p $x 9 DB<15>
as you can see, you can change the states of passed variables.
That's normally the most maintainable approach, especially when combined with a good name for the operation.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to self define a operator
by toothedsword (Sexton) on Oct 22, 2019 at 15:08 UTC |