in reply to Re^2: Extracting DNC issues
in thread Extracting DNC issues

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.

Replies are listed 'Best First'.
Re^4: Extracting DNC issues
by MoodyDreams999 (Scribe) on Oct 09, 2023 at 15:26 UTC
    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
      Isn't it in the while loop though

      Not in the code you posted:

      my $dnc_col = ''; while (my $row = $csv->getline($input))

      Unless I misunderstand your intention, I think you should swap the order of these two lines.


      Improve your skills with Modern Perl: the free book.