Problems? Is your data what you think it is? | |
PerlMonks |
Re: How to avoid string copies in function calls?by davido (Cardinal) |
on Nov 09, 2011 at 07:33 UTC ( [id://936980]=note: print w/replies, xml ) | Need Help?? |
"Are there other ways to avoid string copies besides using references?" There are the ugly ones, like storing the string in a global variable and not passing it around at all; just acting upon the global instance of it. The reference approach is probably a better solution. "Does it make sense to submit enhancement requests to these standard modules to have the possibility to get the result by reference?" It makes more sense to submit patches that implement your request in a way that doesn't forcibly export anything additional, and doesn't cause the modules to fail their existing test suite. Additionally, you would want to include a full set of tests for the patch you submitted, along with a POD patch. In other words, you're providing the added functionality, not wrecking code that uses the module (not exporting anything new by default), not wrecking the module itself (it still passes its test suite), and providing your own proof that your patches work, and full documentation. If that doesn't get anyone's attention, subclass the module in question, or for non-OO modules, write a wrapper module that adds your functionality while passing through all the old functionality too. Upload to CPAN. Dave
In Section
Seekers of Perl Wisdom
|
|