Re: How to match string inside of array?



In article <4YHof.11993$fY5.2618@trnddc02>, Jürgen Exner
<jurgenex@xxxxxxxxxxx> wrote:

> somebody wrote:
> > How do I check if $myvar matches 'two' in @arr?
> >
> > I know I could iterate through the array with
> > a foreach statement, but was wondering if there
> > was a more efficient method.
>
> perldoc -q contains

In my version (5.8.6) you have to search for "contained"

FYI to OP: this newsgroup is defunct; try comp.lang.perl.misc in the
future.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.



Relevant Pages

  • Re: How to match string inside of array?
    ... > How do I check if $myvar matches 'two' in @arr? ... > I know I could iterate through the array with ... > a foreach statement, ...
    (comp.lang.perl)
  • Re: How to match string inside of array?
    ... >> I know I could iterate through the array with ... >> a foreach statement, ... mybox:> perldoc -q contains ...
    (comp.lang.perl)
  • How to match string inside of array?
    ... If I have an array like: ... I know I could iterate through the array with ... a foreach statement, ... was a more efficient method. ...
    (comp.lang.perl)
  • Passing a Array into a com object
    ... I need to pass an array into a com object, ... object xlFiles = new Object; ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (microsoft.public.dotnet.languages.csharp)
  • How can I make a method thad create matrix?
    ... I know that that function create an array has 2 ... colums but then what should I do? ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (microsoft.public.dotnet.languages.csharp)