if condition with RE match

Posted on 2011-10-12
Last Modified: 2012-05-12
This is related to

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
                    my @time_values = map { int (hex($_)/1000 + 0.5) } (@values[6..11]);
                    print $fhBye '"' . join('","', (@values[0..5],@time_values,$values[12])) . '"' . "\n";
                    #Skip this record as it does not match the criteria
                    print $line;

Question by:farzanj
    LVL 9

    Accepted Solution

    The parentheses surrounding if(@values should terminate before the { and not where they are.
    LVL 31

    Author Closing Comment

    Thank you sir.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now