More on the 5.8.1 Migration

Ovid on 2003-10-29T17:23:50

More fun trying to get our code to run under 5.8.1. The latest pain has come from people trying to munge XML with regular expressions and assuming that the attribute order for tags is static. Because our XML generator relies on hashes to track key/value pairs, this assumption is wrong. I keep getting bitten by this, but the latest problem was by the following snippet:

$xml =~ s/TransmissionDate=".*"/TransmissionDate=""/;

And the First Circle of Hell (reserved for the virtuous (because they test) pagans) will have one more inhabitant. This will be the person who wrote a series of tests that asserted that certain SQL queries will take X number of seconds to run. Usually this is true, but I discovered intermittant failures in these tests -- no surprise there -- but rather than fix them, I decided to do some investigating. I couldn't believe that I was the only person who was having these test failures, even if I was the only person running 5.8.1. As it turns out, programmers were so used to seeing intermittant failures of this particular test program that they ignored them. This almost completely negates the benefits of testing.


Bitten

petdance on 2003-10-29T22:19:10

$xml =~ s/TransmissionDate=".*"/TransmissionDate=""/;
Was the problem that it shoulda been
$xml =~ s/TransmissionDate="[^"]+"/TransmissionDate=""/;
or something else?

Re:Bitten

Ovid on 2003-10-29T22:23:36

You nailed it. Either a negated character class or a choose a less greedy match.

<data TransmissionDate="20030412" Transaction="Complete">