different output using perl to parse tab-delimited files : In the `perl` script below written in a `shell`, if I use the `tab-delimited` `numeric` file, I get the desired result of each line parsed accordingly. However, if I use the `alpha` file as input only the first line is parsed. It is the exact same script and the only difference between `alpha` and `numeric` is that in `alpha` the `NC_000023.11:g.41747805_41747806delinsTT` and `NC_000023.11:g.41750615C>A` in `numeric` is `NC_0000X.11:g.41747805_41747806delinsTT` and `NC_0000X.11:g.41750615C>A` in `alpha`.  What am I missing? Thank you :).

**numeric**

    Input Variant	Errors	Chromosomal Variant	Coding Variant(s)
    NM_003924.3:c.*18_*19delGCinsAA		NC_000023.11:g.41747805_41747806delinsTT	LRG_513t1:c.*18_*19delinsAA	NM
    NM_003924.3:c.013G>T		NC_000023.11:g.41750615C>A	LRG_513t1:c.13G>T	

perl

    perl -ne 'next if $. == 1;
      if(/.*del([A-Z]+)ins([A-Z]+).*NC_0+([^.]+)\..*g\.([0-9]+)_([0-9]+)/)   # indel
     {
         print join("\t", $3, $4, $5, $1, $2), "\n";
    }
     else
    {
             while (/\t*NC_(\d+)\.\S+g\.(\d+)(\S+)/g) {                                            # conditional parse
                 ($num1, $num2, $common) = ($1, $2, $3);
                 $num3 = $num2;
                 if    ($common =~ /^([A-Z])>([A-Z])$/)   { ($ch1, $ch2) = ($1, $2) }              # SNP
                 elsif ($common =~ /^del([A-Z])$/)        { ($ch1, $ch2) = ($1, "-") }             # deletion
                 elsif ($common =~ /^ins([A-Z])$/)        { ($ch1, $ch2) = ("-", $1) }             # insertion
                 elsif ($common =~ /^_(\d+)del([A-Z]+)$/) { ($num3, $ch1, $ch2) = ($1, $2, "-") }  # multi deletion
                 elsif ($common =~ /^_(\d+)ins([A-Z]+)$/) { ($num3, $ch1, $ch2) = ("-", $1, $2) }  # multi insertion
                 printf ("%d\t%d\t%d\t%s\t%s\n", $num1, $num2, $num3, $ch1, $ch2);                 # output
                 map {undef} ($num1, $num2, $num3, $common, $ch1, $ch2);
             }
    }' numeric
    23	41747805	41747806	GC	AA
    23	41750615	41750615	C	A

**alpha**

    Input Variant	Errors	Chromosomal Variant	Coding Variant(s)
    NM_003924.3:c.*18_*19delGCinsAA		NC_0000X.11:g.41747805_41747806delinsTT	LRG_513t1:c.*18_*19delinsAA	NM_003924.3:c.*18_*19delinsAA
    NM_003924.3:c.013G>T		NC_0000X.11:g.41750615C>A	LRG_513t1:c.13G>T	NM_003924.3:c.13G>T



**output using alpha:**

    X	41747805	41747806	GC	AA



