in reply to Skip header text when comparing time

It would help if we knew what the header looks like. I think you would want to look for something unique in the header line that does not exist in the other lines. Do you have a sample of the input?
  • Comment on Re: Skip header text when comparing time

Replies are listed 'Best First'.
Re^2: Skip header text when comparing time
by ITmajor (Beadle) on Jan 20, 2009 at 21:15 UTC
    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.
      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/)