in reply to Re^2: handling erronous input
in thread handling erronous input

In addition to the problems with your first regex,
($hour,$minute,$second) = split(":",$time);) should be
($hour,$minute,$second) = split /:/,$time;

The pattern in split is a regex and needs slashes (or other unambiguous matched punctuation), not quotes. Note also that the last closing paren in your split is "one too many" (and thus, "wrong) and all the parens on the RHS are unnecessary.

Subject to your taste, note that your extraction to $quote and $timecould be written

next unless ( $data =~ /^(\d\.\d{5})\s,(\d\d:\d\d:\d\d).*/ ); $quote = $1; $time=$2;

Update: s/not/note/ in the last narrative paragraph.

Replies are listed 'Best First'.
Re^4: handling erronous input
by apl (Monsignor) on Apr 07, 2008 at 12:06 UTC
    Or

    next unless ( $data =~ /^(\d\.\d{5})\s,(\d{2}:\d{2}:\d{2}).*/ ); $quote = $1; $time=$2;