in reply to OT: if loop (was Re: perl grep with regex)
in thread perl grep with regex

It was completely mistake at my end. Doing lot of things together can make one to make such mistake.
  • Comment on Re: OT: if loop (was Re: perl grep with regex)

Replies are listed 'Best First'.
Re^2: OT: if loop (was Re: perl grep with regex)
by jeffa (Bishop) on Jun 30, 2014 at 14:42 UTC

    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)