Although use constant LIST=>(@keys) defines a list constant, Perl doesn't currently optimize this like it does with scalar constants. So every time you use the constant, it performs a sub call. That's why it's slower.
Update: it seems my knowledge was out of date. I've just checked and it turns out they were optimized in Perl 5.20. I'm guessing they weren't optimized quite as well as scalar constants though.
In reply to Re: Benchmark: Constant List in Hash Slice
by tobyink
in thread Benchmark: Constant List in Hash Slice
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |