in reply to perl grep with regex

swissknife:

I have a question: Where did you find the term "if loop"? I've seen it here on perlmonks a few times as of late, and I'm wondering if there's a common source of (mis)information that causes people to think if statements are looping constructs.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on OT: if loop (was Re: perl grep with regex)

Replies are listed 'Best First'.
Re: OT: if loop (was Re: perl grep with regex)
by swissknife (Sexton) on Jun 30, 2014 at 13:41 UTC
    It was completely mistake at my end. Doing lot of things together can make one to make such mistake.

      You really should consider keeping your code properly formatted for maximum readability. Tools like PerlTidy can help you:

      foreach $strfile (@arr1) { @arr3 = split(/[.\n]/, $strfile); if (grep (/^@arr3[1]$/, @arr2)) { print "Entered in IF"; } else { print "Entered in ELSE"; } }

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)