in reply to Extracting DNC issues

Should this line in be in the while loop?

my $dnc_col = '';

Improve your skills with Modern Perl: the free book.

Replies are listed 'Best First'.
Re^2: Extracting DNC issues
by MoodyDreams999 (Scribe) on Oct 06, 2023 at 21:39 UTC
    No, I'm trying to do if the number doesn't exist in combined numbers then it should be dnc All I'm doing is comparing phone numbers, we get one set of numbers, we run that through black list, we get fdnc and clean from that number set. so I take clean and fdnc against All the numbers basically whatever is left over in all and that isnt in the other 2 is the dnc numbers.
      I'm trying to do if the number doesn't exist in combined numbers then it should be dnc

      I understand that, but $dnc retains the previous value you assigned every time through the loop, so I wonder if that's what you intended. If you move the declaration and assignment into the loop, $dnc will be an empty string unless the current number doesn't exist in combined numbers.

      I don't know if that's what you want though.


      Improve your skills with Modern Perl: the free book.

        Yes, so that was probably the issue I was having. DNC isnt a column until we create it, so it should be an empty string unless the current number doesn't exist in combined numbers. Isn't it in the while loop though, the ending bracket for while loop is after that statement
      Until this reply, I had no idea what you meant by DNC. I still don't know the significance of the other terminology, either, like "cleaned" or "combined". And without input or output I just kind of shrugged and moved on. You seem to assume we know something about these files you're processing.

      I'd suggest restructuring the post to start with what you expect to accomplish with the code, a short example of input, the incorrect output you get now, and what correct output would look like.

        Until this reply, I had no idea what you meant by DNC

        A simple google would have told you that DNC refers to either Democratic National Committee or District of North Carolina.

        FDNC is easier, clearly referring to the fascinating book, The Future Does Not Compute: a philosophical exploration of some of the darker aspects of computers, with a probing emphasis on networked computers that mimic true communities. :)