sev: (Default)
sev ([personal profile] sev) wrote2005-01-09 12:27 pm

sheesh.

fucking spamassassin and their fucking memory-hog code.

SCALAR EACH IS YOUR FRIEND, DIPSHIT.

sheesh. I did *not* need to be optimizing code written by people I've never met. (EDIT: though technically, in my mind, addressing 'out of memory' errors that crop up under normal usage isn't optimizing anymore; it's debugginging.)

[identity profile] nmc.livejournal.com 2005-01-09 01:35 pm (UTC)(link)
But I thought if code was reasonably written, it wasn't good Perl?

You wouldn't want the SpamAssassin people to write bad Perl, now, would you?

*innocent*

[identity profile] nmc.livejournal.com 2005-01-09 07:12 pm (UTC)(link)
I will not laugh at my friend's misfortune.
I will not laugh at my friend's misfortune.
I will not laugh at my friend's misfortune.

*giggle*

Well, at least I didn't laugh.
ext_243: (Default)

Re: it gets worse...

[identity profile] xlerb.livejournal.com 2005-01-09 09:21 pm (UTC)(link)
I don't want to think about that.

Re: it gets worse...

[identity profile] cjcollier.livejournal.com 2005-01-13 11:56 am (UTC)(link)
Eew. Is that even possible?
ext_243: (Default)

[identity profile] xlerb.livejournal.com 2005-01-09 09:33 pm (UTC)(link)
There's More Than One Way To Do It.

Although it would be nice if Perl could recognize that, in for $x (keys %y) { foobar $x }, the array value of that keys %y is never actually used as such and so doesn't need to be constructed. I can understand if static analysis would be too much, but surely there's already enough runtime magic strewn about that this kind of thing can be tossed in. (For example, having while ($x = each %y) { foobar $x } not halt when the key is "0" or "".)

On the other hand, at what point does Perl stop being a scripting language and start being a DB query planner?
ext_243: (Default)

[identity profile] xlerb.livejournal.com 2005-02-04 09:13 am (UTC)(link)
grep (and map) would make it a little trickier; it'd have to make sure the predicate/block is free of side-effects so that the lazy-evaluation thing can be done without possibly changing the code's behavior. I think.

(Bigger chainsaw!!!)

[identity profile] cjcollier.livejournal.com 2005-01-13 11:59 am (UTC)(link)
while( defined $x = each %y ) foobar $x doesn't halt on "0" or ""

In a lot of cases, you want to halt on false-evaluating values, and it's relatively simple to add a C<defined> operator.

[identity profile] cjcollier.livejournal.com 2005-01-13 11:55 am (UTC)(link)
did someone do a foreach(){ ... } ?

I hate that one, and it seems that *everyone* and their brother does it.