in reply to Re^2: Pointers and References
in thread Pointers and References
I don't really think of mutable arguments like that as "output parameters". "I/O parameters" maybe. I the sense that C like languages use output parameters where the sole job of the parameter is to return information from the function I don't see a need for output parameters in Perl, although passing references in the parameter list could be used that way.
The run time and memory cost of returning a reference to a large structure, or a list of references to large structures has essentially the same overhead on Perl as passing references back as parameters. Since returning a list of stuff is natural in Perl returning a list of references makes for easier to understand code than working with output parameters.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Pointers and References
by bliako (Abbot) on Nov 24, 2020 at 01:21 UTC | |
by LanX (Saint) on Nov 24, 2020 at 12:17 UTC | |
by bliako (Abbot) on Nov 24, 2020 at 19:33 UTC | |
by LanX (Saint) on Nov 24, 2020 at 19:52 UTC | |
by bliako (Abbot) on Nov 24, 2020 at 20:38 UTC | |
| |
by Leudwinus (Scribe) on Nov 25, 2020 at 15:33 UTC | |
| |
by AnomalousMonk (Archbishop) on Nov 24, 2020 at 20:13 UTC | |
by Leudwinus (Scribe) on Nov 25, 2020 at 15:37 UTC | |
by bliako (Abbot) on Nov 24, 2020 at 20:44 UTC |