Re: This seems to ease

2003-12-09 Thread James Edward Gray II
On Dec 9, 2003, at 1:28 AM, [EMAIL PROTECTED] wrote: I didn't know "List::Util", but I have something done by myself. Probably everyone that don't know this module has one. List::Util is a standard module now and worth a look. perldoc List::Util James -- To unsubscribe, e-mail: [EMAIL PROTECTE

RE: This seems to ease

2003-12-09 Thread Marcos . Rebelo
efore I sent the e-mail. To this I have to think in function as well. Like I seed this seems to ease. For the rest of the answers. I didn't know "List::Util", but I have something done by myself. Probably everyone that don't know this module has one. Now the grep I use gr

Re: This seems to ease

2003-12-08 Thread Casey West
It was Monday, December 08, 2003 when [EMAIL PROTECTED] took the soap box, saying: : I did the 'in' function for seeing if one element is inside on list like. : : sub in { : my $match = shift; : foreach (@_) { : return 1 if $match eq $_; : } : return 0; : } : : so I'm call

Re: This seems to ease

2003-12-08 Thread Wiggins d Anconia
> On Dec 8, 2003, at 9:05 AM, Wiggins d Anconia wrote: > > > I did the 'in' function for seeing if one element is inside on list > > like. > >> > >> sub in { > >> my $match = shift; > >> foreach (@_) { > >> return 1 if $match eq $_; > >> } > >> return 0; > >> } > >> > >>

Re: This seems to ease

2003-12-08 Thread Jeff 'japhy' Pinyan
On Dec 8, Wiggins d Anconia said: >> I did the 'in' function for seeing if one element is inside on list like. > >While I realize your question is more about creating operators, etc. >Would 'grep' not work the same as the above? But his in() function short-circuits; grep() does not. grep() will

Re: This seems to ease

2003-12-08 Thread James Edward Gray II
On Dec 8, 2003, at 9:05 AM, Wiggins d Anconia wrote: I did the 'in' function for seeing if one element is inside on list like. sub in { my $match = shift; foreach (@_) { return 1 if $match eq $_; } return 0; } so I'm calling the function like if(in($x => (1,2,3))) { ..

Re: This seems to ease

2003-12-08 Thread Wiggins d Anconia
> I did the 'in' function for seeing if one element is inside on list like. > > sub in { > my $match = shift; > foreach (@_) { > return 1 if $match eq $_; > } > return 0; > } > > so I'm calling the function like > > if(in($x => (1,2,3))) { >... > }; > While I rea

Re: This seems to ease

2003-12-08 Thread Jeff 'japhy' Pinyan
On Dec 8, [EMAIL PROTECTED] said: >I did the 'in' function for seeing if one element is inside on list like. Well, although it's overkill, Quantum::Superpositions has a 'any' function that can be used like so: if ($x == any(1, 4, 9, 16)) { ... } But Q::SP is a really big module, and won't wor

This seems to ease

2003-12-08 Thread Marcos . Rebelo
I did the 'in' function for seeing if one element is inside on list like. sub in { my $match = shift; foreach (@_) { return 1 if $match eq $_; } return 0; } so I'm calling the function like if(in($x => (1,2,3))) { ... }; this seems to be nice. After this I sink: why