Help for this page

Select Code to Download


  1. or download this
    index ("@array", $sought) > -1;
    
  2. or download this
    @a = qw( food bar baz );
    $" = "\0"; 
    ...
    print "Found\n" if index "@a", qq/foo$"/;   # Rightly fails.
    print "Found\n" if index "@a", qq/$"bar$"/; # Rightly succeeds...
    print "Found\n" if index "@a", qq/$"baz$"/; # Wrongly fails.
    
  3. or download this
    print "Found\n" if index qq($"@a$"), qq/$"foo$"/;