Welcome to the Monastery | |
PerlMonks |
Re: UBB find user id codeby arturo (Vicar) |
on Oct 10, 2001 at 00:08 UTC ( [id://117850]=note: print w/replies, xml ) | Need Help?? |
I don't get why you're maintaining a lot of information that you're not going to use. That's a *lot* of variable declarations in there, some of which aren't needed through the whole routine. There's also a lot that can make your code more compact and elegant. Case in point:
Can be elegantly compacted into
( warning: these aren't entirely equivalent, but since you're only interested in %cookies within that if block, you shouldn't notice the difference here.)
Note also that
is equivalent to
IMO, the second is much easier to follow. The main thing you're looking for: you want to stop once you've found the right line in the "members" file. So use last -- not break ( some C coder musta misremembered) -- to break out of the loop. It's not really use strict that causes the complaint, it's the fact that the parser doesn't recognize break as a keyword, and so thinks it's a bareword, which causes strict to complain. In reality, it's a syntax error.
In Section
Seekers of Perl Wisdom
|
|