X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=blobdiff_plain;f=videosite%2Freadme.txt;fp=videosite%2Freadme.txt;h=697ff42184f5718f4e5eda1d1f7a0f9695063ba9;hp=943e4302dfa426321db886446329669da01855f1;hb=debab097d66f3bd735e837a146bc81d09e420961;hpb=9bb78db68a79470e45dd6400321e3dd96ffcb20b diff --git a/videosite/readme.txt b/videosite/readme.txt index 943e430..697ff42 100644 --- a/videosite/readme.txt +++ b/videosite/readme.txt @@ -143,20 +143,13 @@ declared as follows: sub new { my $class = shift; - my $self = $class->SUPER::new(); - - $self->{'_PARAMS'} = {'FOO' => [42, 'This is the FOO parameter, twiddle it to do stuff']}; - bless($self, $class); - $self->_prepare_parameters(); - - return $self; + my $self = $class->SUPER::new( + _PARAMS => {'FOO' => [42, 'This is the FOO parameter, twiddle it to do stuff']}, + @_, + ); + return bless($self, $class); } -b) as seen in the example above, after declaring the parameter hash, call the -method _prepare_parameters() on your class instance. This will convert the -hash into the internally used data structure and prepare it for automatic -loading and saving. - -c) to access one of the parameters, call the _getval() method, giving the name +b) to access one of the parameters, call the _getval() method, giving the name of the parameter as first argument. This will return the current value of that -parameter (either the default value or the user defuned value). +parameter (either the default value or the user defined value).