in reply to Re: Skip header text when comparing time
in thread Skip header text when comparing time

Here is an example of the headers:

oau-iperf-sip oau-iperf-sip s-oau-dr0 s-oau-dr0 s-swau-dr0 s-swau-dr0 swau-iperf-sip swau-iperf-sip swau-iperf-sip

The headers may change, so I want to skip the line of headers completely and only compare the lines with numbers. When it comes across a header, I want it to skip that line but continue to compare the lines with numbers.
  • Comment on Re^2: Skip header text when comparing time

Replies are listed 'Best First'.
Re^3: Skip header text when comparing time
by Osiris1975 (Novice) on Jan 21, 2009 at 14:52 UTC
    So, I imagine the headers will never have a time in them? Time has a a ":" in it that should be unique to them. So maybe instead of :
    if ($line =~ /^\b\d/)
    You could use
    if ($line =~ m/:/)
    I didn't test it since I don't have a sample of your input, but something along those lines should process your steps only if the lines have a colon in them. Alternatively, if the headers and only the headers contain "perf" in them, you could do
    if ($line !~ m/perf/)