in reply to Persistent Variable
Another way of doing this is to turn $state into an object, and turn one, two and three into object methods.my $state = { username => $username, sessionid => $sessionid, whatever => $else, }; &one($state, $other_args); &two($state, @more); &three($state);
I kind of like things like Class::Struct for defining a simple object-ish representation of a data structure like that, which is easy to pass around as a single unit.$state = new Object($username, $sessionid); $state->one($other_args); $state->two(@more); $state->three;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Persistent Variable
by Anonymous Monk on Jan 15, 2001 at 22:35 UTC | |
by Fastolfe (Vicar) on Jan 15, 2001 at 23:17 UTC |