Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

chaoticset
  (email not shown publicly)
http://chaoticset.perlmonk.org/
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [perlmonks.org], and here [javajunkies.org] too, I ramble randomly in my philosophical blog [blogspot.com] and my other blog [blogspot.com]. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Thursday November 01, 2001
12:35 PM

It's The Data, Stupid

[ #1132 ]
It was, too. I wondered why I couldn't get errors to at least *change* when I modded the code. Pretty simple. I'll explain it to myself for future reference.

First, the good news: The page loads properly again. Bad news: It's not doing what it's supposed to (it's actually printing ARRAY REFERENCES instead of number in stock, but I think I've got a way to fix it). If that resolves today, I'll be happy.

I got the usual errors about uninitialized values in eq statements. Code code code, fiddle fiddle, run. Same errors. Repeat five or ten times, same errors.

The new stock data is formatted:

name=stock=cost=shown

The old one is formatted:

name=stock=cost

I didn't point the file opening sub at the new data file. It was trying to read four things per line out of a file with only three things per line.

Now it's time for a different kind of error. Rooting through the stock file reveals that *a whole bunch of cards have 0 cost values*. That is, they have a 0 for cost.

The code doesn't allow this - I made a sub to handle it quick'n'dirty:

sub myint {

if ($_[0]
if ( ($_[0] return int ($_[0] + 1) ;
} else {
return int $_[0];
}

}

For now, that takes a possibly decimal amount, converts it to the "nearest dollar amount", and returns an integer value. (Eventually, it'll be a little more sophisticated in its crudeness; it'll round to quarter-dollar amounts. Slightly more elegant mangling.)

I suspect the culprit is this even though I lack proof. (In fact, I'm probably wrong.) Evidence and solutions I go a-searchin' for now...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.