in reply to Minimisation of codes (if grep {})
Hello ravi45722,
By this my program is getting too late.
In addition to the if / elsif / ... / else construct suggested by Corion, you might gain a speedup by using List::Util::any in place of grep. From the documentation for List::Util:
Many cases of using grep in a conditional can be written using any instead, as it can short-circuit after the first true result.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Minimisation of codes (if grep {})
by ravi45722 (Pilgrim) on Oct 01, 2015 at 11:05 UTC | |
by hippo (Archbishop) on Oct 01, 2015 at 11:10 UTC | |
by ravi45722 (Pilgrim) on Oct 01, 2015 at 11:16 UTC | |
by choroba (Cardinal) on Oct 01, 2015 at 11:28 UTC | |
by ravi45722 (Pilgrim) on Oct 01, 2015 at 12:10 UTC | |
|