in reply to Re: handling erronous input
in thread handling erronous input
fwiw, based on your well explained pattern matching sequences above, i have also created a possible revised unless statement
How does that look? although i do like the way you have done things.. because of an internet outage here the last 4 hours , i was unable to do any testing of new code and had to bring up my old buggy code live @ 5pm E.S.T .. id really like to able to just drop in a new unless statement into the existing code , if thats at all possible?open(DATAFILE, "$input") || die("Can't open $input:!\n"); while (<DATAFILE>) { unless (m{^(\d\.d{5})\s,(\d\d:\d\d:\d\d)\s*}) { next; } chomp $_; ($quote,$time) = split(",", $_); chop($quote); #remove a white space ($hour,$minute,$second) = split(":",$time);) # more processing
The script eventually updates a mysql database and and creates webpage.. so its not straightforward testing the code out of a live situation so i want to keep revisions to a minimum.
p.s i realise that i may be dismissing some of the conventions of working with floating point numbers which may be a little unsettling to some, but for this project i am sure that the 'shortcuts' i am taking are safe. I have my code working fine in a live environment for 2 weeks now. The only issue i have is this bug when dealing with unexpected input data formats in my input files.
p.p.s sorry for being so verbose here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: handling erronous input
by FunkyMonk (Bishop) on Apr 06, 2008 at 22:57 UTC | |
by GrandFather (Saint) on Apr 06, 2008 at 23:35 UTC | |
by Conal (Beadle) on Apr 06, 2008 at 23:50 UTC | |
|
Re^3: handling erronous input
by ww (Archbishop) on Apr 07, 2008 at 02:55 UTC | |
by apl (Monsignor) on Apr 07, 2008 at 12:06 UTC |