in reply to Several stupid questions about subs
This is one of my favorite reasons for using Perl “objects.” The standard way of doing this in Perl might not conform to anyone’s college textbook, but it nevertheless is quite practical. An object is basically “a blessed hash,” and as such it contains both code and data in one convenient, self-ecapsulated “thing.” Each instance of an object neatly stands by itself, with easy access to “its” data. Variables declared within the package are naturally shielded from anyone outside. And so on. It is a pragmatic solution to issues kind-of like the ones you are considering now ... and never mind your college textbook, anyway.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Several stupid questions about subs
by Argel (Prior) on Apr 13, 2011 at 21:21 UTC | |
by locked_user sundialsvc4 (Abbot) on Apr 14, 2011 at 18:14 UTC |