I have a script which was written, and works as expected, in ActivePerl. It has been tested on a UNIX machine and works fine on there also. However, it does not work on another user's computer who uses Cygwin rather than ActivePerl. The part of the script that does not work as expected is as follows:
sub match_randomized_lists { $count = 0; open (RANDOMIZED_LIST, $randomized_list) || die print "Script cann +ot open $randomized_list"; my @randomized_list = <RANDOMIZED_LIST>; print $randomized_list; print "\n"; print @randomized_list; print "\n"; foreach my $list_to_match (@array_of_lists_to_match) { $count = $count + 1; print OUTPUT "NUMBER "; print OUTPUT $count; $match_count = 0; foreach my $randomized_entry (@randomized_list) { chomp $randomized_entry; if ($list_to_match =~ /$randomized_entry/) { $match_count = $match_count + 1; } } print OUTPUT ": "; print OUTPUT $match_count; print OUTPUT "\n\n"; } }
The code is intended to match each element of the array of randomized entries with the lists of entries in the "array of lists to match". If there is a match, the match counter increases by 1.

This way for each randomized list, I get a total number of matches with each list of entries. This is printed to an output file and further calculations are carried out on these at a later stage.

In ActiveState and UNIX, the subroutine works as expected, finding matches. In Cygwin, it never finds any matches.
Before I resort to installing Cygwin on my own computer, is/are there any known issues with anything in my code and Cygwin?


In reply to Doesn't work in Cygwin by maybeD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.