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
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
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
> 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;
> >> }
> >>
> >>
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
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))) {
..
> 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
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
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