in reply to Search element of array in another array

P.S.: A step forward: I tried IO::ALL and scalar @allwords reports 10 elements ... But still no matches found.

Perhaps you need to chomp @allwords?

Again, Data::Dumper (especially its Useqq option) or Data::Dump are useful to see the actual strings.

BTW, be careful with IO::All, it is easy to create ETOOMUCHMAGIC errors with it...

Replies are listed 'Best First'.
Re^2: Search element of array in another array
by better (Acolyte) on Mar 26, 2015 at 20:22 UTC

    $Data::Dumper::Useqq = 1;

    This is really amazing!

    @allwords

    $VAR9 = "hat\r";

    @cleanwords

    $VAR6 = "hat";

    How can I get rid of the \r? I vaguely remember I had this problem before...

      Probably this:
      s/\r//g;
      (if the variable if contained in $_), or, otherwise, something like this:
      $var =~ s/\r//g;

      Je suis Charlie.