• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

if condition with RE match

This is related to
http://www.experts-exchange.com/Networking/Linux_Networking/Q_27392853.html?cid=239#a36956236

Can you please correct this syntax?
 
         if ($type =~ 'BYE')
            {
                # [<]+\W*([0-9a-z]+).*?\s+    #0. Call Session ID
                if (@values) = $line =~ m/[^F]*?
                             From[:][^<]+<sip:([^>]+)>.*?           #1. Orig_Device_PIN (From)
                             To[:][^<]+<sip:([^>]+)>.*?             #2. Dest_Device_PIN (To)
                             Call-ID[:]\s*(\S+).*?                 #3. Call-ID
                             User-Agent[:].*?([0-9.]+).*?          #4. Agent version
                             Reason[:].*?cause=(\d+).*?            #5. Term_Cause
                             AFE=\S(\S\S)\S                        #6. Call_Type
                                 \s(\w+)                           #7. Call Setup Time*
                                 \s(\w+)                           #8. ICE check time*
                                 \s(\w+)                           #9. Start to Invite Time*
                                 \s(\w+)                          #10. Invite to 180*
                                 \s(\w+)                          #11. Time 180 to 200*
                                 \s(\w+)                          #12. Total Call Time*
                                 [^V]*VfxRxBitrate=([.0-9]+)      #13. VfxRxBitrate
                                 /sx;
                {
                    $count{'cBye'}++;
                    my @time_values = map { int (hex($_)/1000 + 0.5) } (@values[6..11]);
                    print $fhBye '"' . join('","', (@values[0..5],@time_values,$values[12])) . '"' . "\n";
                }
                else
                {
                    #Skip this record as it does not match the criteria
                    $count{'cSkip'}++;
                    print $line;
                }

            }
0
farzanj
Asked:
farzanj
1 Solution
 
parparovCommented:
The parentheses surrounding if(@values should terminate before the { and not where they are.
0
 
farzanjAuthor Commented:
Thank you sir.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now