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.
In reply to Re^2: handling erronous input
by Conal
in thread handling erronous input
by Conal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |