I find myself writing snippets of code inside other modules and scripts that look like this:
And then elsewhere:{ # localize $foo my $foo = 0; use constant FOO_CYCLE => 23; sub note_a_foo { $foo++; } sub check_foo { return unless $foo >= FOO_CYCLE; $foo = 0; do_something_about_foo; } }
The block localizing the $foo counter isn't really an object; what would you call it? I've got enough of these now in my production code that I'd like to have some term for them, like "nugget" or "black box" or "micro-object", so that my documentation for each can be more immediately meaningful to another reader. Is there a commonly used term for such a construct?for (long_loop) { ... note_foo; ... }
-- Jeff Boes vox 269.226.9550 ext 24 Database Engineer fax 269.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com ...Nexcerpt...Connecting People With Expertise
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Smaller than an object?
by perrin (Chancellor) on Aug 21, 2002 at 19:32 UTC | |
Re: Smaller than an object?
by Aristotle (Chancellor) on Aug 21, 2002 at 21:04 UTC | |
Re: Smaller than an object?
by theorbtwo (Prior) on Aug 21, 2002 at 21:31 UTC | |
Re: Smaller than an object?
by chromatic (Archbishop) on Aug 21, 2002 at 21:39 UTC | |
by Abigail-II (Bishop) on Aug 22, 2002 at 11:15 UTC | |
Re: Smaller than an object?
by erikharrison (Deacon) on Aug 21, 2002 at 19:19 UTC | |
Re: Smaller than an object?
by astaines (Curate) on Aug 22, 2002 at 12:33 UTC |
Back to
Meditations