in reply to Re: Re3: Code rot?
in thread Code rot?

Please also post all the elsif() lines to that if(). I'd think there must be one, because there is no string concatanation in the if().

BTW: Warnings in elsif() conditions are reported with the line number of the if(). Nice to know...

Replies are listed 'Best First'.
Re: Code rot?
by aarestad (Sexton) on Sep 23, 2003 at 13:01 UTC
    Dragonchild: To your 2 points, I have now changed the script so that it passes use strict - still getting warnings. I have also ensured that the lines are coming back with data in it (105 lines in my test file, and I get 105 warnings).

    Beechbone: Here are all the elsifs:

    if (!$desc and /^(\w+):$/) { # ... } elsif (/^\{$/) { # ... } elsif (/^\}$/) { # ... } elsif (!$desc and /^"?$screen"?\.(.+):/) { # ... } elsif ($desc and /^\s*id:\s*(\d+)$/) { # ... } else { # ... }
    As you can see, no concatenations in the elsifs, just a bunch of regexes. If you'd like, I can post the whole script, but I'll wait till someone says they want it. Thanks.
      Here is the concatenation:
      } elsif (!$desc and /^"?$screen"?\.(.+):/) {
      $screen is concatenated with the rest of the regex. I'd bet it was undef...
      Well well well. It seems running this script using the latest ActivePerl binary works just fine! There must be something broken with Cygwin's Perl... I'll take this up with the Cygwin people. Thanks anyway.

      EDIT: The problem was solved because Cygwin's perl was expecting Unix linefeeds, and my source file uses Windows CRLF. I was told that setting the environment variable

      export PERLIO=crlf
      solves this problem, and it did nicely. I'm also told, though, that it's a bit buggy, but in this case, it solves the mysterious difference between Cygwin Perl and ActivePerl. Cheers!