summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm
diff options
context:
space:
mode:
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm
index c593dc7c39..a574734e5c 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/Class/Struct.pm
@@ -14,7 +14,7 @@ require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(struct);
-$VERSION = '0.66';
+$VERSION = '0.68';
my $print = 0;
sub printem {
@@ -84,7 +84,7 @@ sub struct {
}
else {
$base_type = 'ARRAY';
- $class = (caller())[0];
+ $class = caller();
@decls = @_;
}
@@ -275,24 +275,24 @@ Class::Struct - declare struct-like datatypes as Perl classes
# declare struct with four types of elements:
struct( s => '$', a => '@', h => '%', c => 'My_Other_Class' );
- $obj = new Myobj; # constructor
+ my $obj = Myobj->new; # constructor
# scalar type accessor:
- $element_value = $obj->s; # element value
+ my $element_value = $obj->s; # element value
$obj->s('new value'); # assign to element
# array type accessor:
- $ary_ref = $obj->a; # reference to whole array
- $ary_element_value = $obj->a(2); # array element value
+ my $ary_ref = $obj->a; # reference to whole array
+ my $ary_element_value = $obj->a(2); # array element value
$obj->a(2, 'new value'); # assign to array element
# hash type accessor:
- $hash_ref = $obj->h; # reference to whole hash
- $hash_element_value = $obj->h('x'); # hash element value
+ my $hash_ref = $obj->h; # reference to whole hash
+ my $hash_element_value = $obj->h('x'); # hash element value
$obj->h('x', 'new value'); # assign to hash element
# class type accessor:
- $element_value = $obj->c; # object reference
+ my $element_value = $obj->c; # object reference
$obj->c->method(...); # call method of object
$obj->c(new My_Other_Class); # assign a new object