in reply to RE: (AgentM) RE (tilly) 2: Load Balancing fun..
in thread Load Balancing fun..
As for the specific example that I directed you to, the return from that code is only part of a list that is used to construct a hash. By returning it as a list, rather than a reference, I am able to just put the entire function straight in the constructor.
The alternative that I suggested should satisfy both of us. In both list and scalar context it does something reasonable. You may consider doing different things in different contexts to be dangerous behaviour. I firmly disagree. Being context sensitive allows code to be both clear and concise. Perl is a member of the short and sweet school of maintainability.
Oh, as for real problems, try a database design where you do a query to get a list of record to work with, and then proceed down the list firing off queries on each record rather than having the original query do everything for you? Or how about having code that scans lists all of the time rather than doing hash look-ups? Or how about having a misconfigured firewall in front of your load balancer?
Those are all problems that gobble up orders of magnitude more performance than trying to make all of your functions return references rather than lists.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE (tilly) 4: Load Balancing fun..
by AgentM (Curate) on Oct 03, 2000 at 01:30 UTC | |
by tilly (Archbishop) on Oct 03, 2000 at 01:47 UTC | |
by dchetlin (Friar) on Oct 03, 2000 at 03:02 UTC | |
by tilly (Archbishop) on Oct 03, 2000 at 03:32 UTC | |
by gumpu (Friar) on Oct 03, 2000 at 13:57 UTC | |
by AgentM (Curate) on Oct 03, 2000 at 01:54 UTC | |
by tilly (Archbishop) on Oct 03, 2000 at 02:33 UTC |