| rmah | erm, man |
| bennymack | eval: @foo = 1 .. 10; grep { $_ == 2 } ? 'yes' : 'no' |
| buubot | bennymack: Error: Search pattern not terminated or ternary operator parsed as search pattern at eval line 1. |
| bennymack | eval: @foo = 1 .. 10; grep { $_ == 2 } @foo ? 'yes' : 'no' |
| buubot | bennymack: 0 |
| rmah | haha |
| bennymack | dam |
| pav | um... |
| rmah | pav, if the list is ordered, do a binary search that'll be O(log N) instead of O(n) |
| merlyn | "Toliet Seat Secrets" :) pav - that's a fAQ |
| rmah | eau de secrete au toilette? |
| thorat | from perlfaq4, "How can I tell whether a certain element is contained in a list or array?" |
| pav | thats to small a problem to write binary search just for that ;) |
| merlyn | yes go read that |
| rmah | oui |
| merlyn | for short lists, grep is quick, List::Utils::first is quicker |
| rmah | pav, maybe the list is 100,000 elements and already sorted |
| merlyn | for long lists used repeatedly, hashes are faster |
| rmah | how the hell should any of us know? |
| pav | oh it really is a faq... sorry about that then |
| merlyn | for long sorted list, binary search is reasonably fast if it's all integers, a bit vector might work well with the vec() function |
| thorat | maybe the perlfaqs should have more descriptive names |
| merlyn | maybe more people need to know about the faqs and read through the TOC weekly |
| thorat | hehe |
| rmah | maybe people shouldn't be asking CompSci 101 questions |
| merlyn | maybe we're already doing everything we can. :) maybe I should have gone to TJ this weekend. :) |
| rmah | hell, HS level questions |
| merlyn | I was teaching programming in high school we used an ASR-33 uppercase only with 110 baud modem connection to the server located 50 miles away our "offline storage" was paper tape ... snow ... both ways ... up hill ... |
| Teratogen | was it an HP-2000? |
| merlyn | HP2100 front and back processor |