PetaMem has asked for the wisdom of the Perl Monks concerning the following question:
my question today is of utter importance for my project. Probably the answer to it will be "you'll have to code it yourself". That'll be ok for me, but I hope I understand all aspects of the problem before I do so. Hence my question:
The Set::Scalar module provides nifty set-functionality. One of the methods is has which returns true if a given element (you give it as a parameter to that method) is member of the set.
The functionality I desperatedly need would be:my $s = Set::Scalar->new('a','b','c(d)'); print $s->has('a'); # returns true
My concrete questions are:my $s = Set::Scalar->new('a','b','c(d)'); if($s->has(/c\((.+)\)/)) { print $1; # prints 'd' }
Bye
PetaMem
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Set::Scalar - Regexp as method parameter?
by broquaint (Abbot) on Apr 27, 2002 at 17:47 UTC | |
|
Re: Set::Scalar - Regexp as method parameter?
by Kanji (Parson) on Apr 27, 2002 at 17:56 UTC | |
by Juerd (Abbot) on Apr 27, 2002 at 20:57 UTC | |
|
Re: Set::Scalar - Regexp as method parameter?
by 2shortplanks (Initiate) on Apr 30, 2002 at 09:48 UTC |