™.. Class::MethodMaker::scalar - Online Linux Manual PageSection : 3
Updated : 2014-05-22
Source : perl v5.10.1
Note : User Contributed Perl Documentation

NAMEClass::Method::scalar − Create methods for handling a scalar value.

SYNOPSIS​ package MyClass; ​ use Class::MethodMaker ​ [ scalar => [qw/ a −static s /]]; ​ ​ sub new { ​ my $class = shift; ​ bless {}, $class; ​ } ​ ​ package main; ​ ​ my $m = MyClass−>new; ​ my $a, $x; ​ ​ $a = $m−>a; # *undef* ​ $x = $m−>a_isset; # false ​ $a = $m−>a(1); # 1 ​ $m−>a(3); ​ $x = $m−>a_isset; # true ​ $a = $m−>a; # 3 ​ $a = $m−>a(5); # 5; ​ $m−>a_reset; ​ $x = $m−>a_isset; # false

DESCRIPTIONCreates methods to handle array values in an object. For a component named ​\*(C`x\*(C'\fR, by default creates methods \f(CW\*(C`x\*(C'\fR, \f(CW\*(C`x_reset\*(C'\fR, \f(CW\*(C`x_isset\*(C'\fR, \f(CW\*(C`x_clear\*(C'\fR. Methods available are: \*(C`*\*(C'\fI\fR ​ $m−>a(3); ​ $a = $m−>a; # 3 ​ $a = $m−>a(5); # 5; Created by default. If an argument is provided, the component is set to that value. The method returns the value of the component (after assignment to a provided value, if appropriate). *_reset ​ $m−>a_reset; Created by default. Resets the component back to its default. Normally, this means that *_isset will return false, and \*(C`*\*(C'\fR will return undef. If ​\*(C`\-default\*(C'\fR is in effect, then the component will be set to the default value, and *_isset will return true. If \*(C`\-default_ctor\*(C'\fR is in effect, then the default subr will be invoked, and its return value used to set the value of the component, and *_isset will return true. Advanced Note: actually, defaults are assigned as needed: typically, the next time a the value of a component is read. *_isset ​ print $m−>a_isset ? "true" : "false"; Created by default. Whether the component is currently set. This is different from being defined; initially, the component is not set (and if read, will return undef); it can be set to undef (which is a set value, which also returns undef). Having been set, the only way to unset the component is with <*_reset>. If a default value is in effect, then <*_isset> will always return true. *_clear ​ $m−>a(5); ​ $a = $m−>a; # 5 ​ $x = $m−>a_isset; # true ​ $m−>a_clear; ​ $a = $m−>a; # *undef* ​ $x = $m−>a_isset; # true Created by default. A shorthand for setting to undef. Note that the component will be set to undef, not reset, so *_isset will return true. *_get ​ package MyClass; ​ use Class::MethodMaker ​ [ scalar => [{'*_get' => '*_get'}, 'a'], ​ new => new, ]; ​ ​ package main; ​ my $m = MyClass−>new; ​ $m−>a(3); ​ $a = $m−>a_get; # 3 ​ $a = $m−>a_get(5); # 3; ignores argument ​ $a = $m−>a_get(5); # 3; unchanged by previous call Created on request. Retrieves the value of the component without setting (ignores any arguments passed). *_set ​ package MyClass; ​ use Class::MethodMaker ​ [ scalar => [{'*_set' => '*_set'}, 'a'], ​ new => new, ]; ​ ​ package main; ​ my $m = MyClass−>new; ​ $m−>a(3); ​ $a = $m−>a_set; # *undef* ​ $a = $m−>a_set(5); # *undef*; value is set but not returned ​ $a = $m−>a; # 5 Created on request. Sets the component to the first argument (or undef if no argument provided). Returns no value.
0
Johanes Gumabo
Data Size   :   14,083 byte
man-Class::MethodMaker::scalar.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   5 / 180,219
Visitor ID   :     :  
Visitor IP   :   3.15.12.133   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Class::MethodMaker::scalar.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Class::MethodMaker::scalar.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Class::MethodMaker::scalar.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|Class::MethodMaker::scalar.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|Class::MethodMaker::scalar.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|Class::MethodMaker::scalar.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|Class::MethodMaker::scalar.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|Class::MethodMaker::scalar.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|Class::MethodMaker::scalar.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|249|Class::MethodMaker::scalar.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|Class::MethodMaker::scalar.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|Class::MethodMaker::scalar.3pm|164|\*(C`x\*(C'\fR, by default creates methods \f(CW\*(C`x\*(C'\fR, \f(CW\*(C`x_reset\*(C'\fR, \f(CW\*(C`x_isset\*(C'\fR, \f(CW\*(C`x_clear\*(C'\fR. |\&\f(CW\*(C`x\*(C'\fR, by default creates methods \f(CW\*(C`x\*(C'\fR, \f(CW\*(C`x_reset\*(C'\fR, \f(CW\*(C`x_isset\*(C'\fR, \f(CW\*(C`x_clear\*(C'\fR. )         (rof_escape_sequence|91|Class::MethodMaker::scalar.3pm|168|\*(C`*\*(C'\fI\fR |\fI\f(CI\*(C`*\*(C'\fI\fR )         (rof_escape_sequence|91|Class::MethodMaker::scalar.3pm|189|\*(C`*\*(C'\fR will return undef. If |this means that \f(CW*_isset\fR will return false, and \f(CW\*(C`*\*(C'\fR will return undef. If )         (rof_escape_sequence|91|Class::MethodMaker::scalar.3pm|190|\*(C`\-default\*(C'\fR is in effect, then the component will be set to the default value, |\&\f(CW\*(C`\-default\*(C'\fR is in effect, then the component will be set to the default value, )         (rof_escape_sequence|91|Class::MethodMaker::scalar.3pm|191|\*(C`\-default_ctor\*(C'\fR is in effect, then the |and \f(CW*_isset\fR will return true. If \f(CW\*(C`\-default_ctor\*(C'\fR is in effect, then the )