in reply to Efficiency of multiple if statements
Does it matter which is "more efficient"?
Are you having a speed problem?
Have you run anything thru Benchmark?
Dijkstra says "Premature optimization is the root of all evil". I would add the corrolary that "'Unnecessary' is, by definition, premature."
That aside, you can pretty easily figure out what makes most sense as your potential bottleneck. What I see is this:
- Check something out on disk
- Do a string check
- Do another string check
And then - Open another process that does a gzip
Where do you think the bottleneck would be? It's sure not gonna be items 2 or 3.
xoxo,
Andy
%_=split/;/,".;;n;u;e;ot;t;her;c; ". # Andy Lester 'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'. # http://petdance.com "hack";print map delete$_{$_},split//,q< andy@petdance.com >
In Section
Seekers of Perl Wisdom