- or download this
# Leacher.pm
package Leacher;
...
sub get_var { return ${$_[0]->{'vars'}->{$_[1]}} }
sub set_var { return ${$_[0]->{'vars'}->{$_[1]}} = $_[2] }
1;
- or download this
# Person.pm
package Person;
...
our $address_3 = 13;
our $address_ = 14;
1;
- or download this
#!/usr/bin/env perl
...
print "vars[1]=".$mp2->get_var('address_1')."\n";
$mp2->set_var('address_1',666);
print "vars[1]=".$mp2->get_var('address_1')."\n";
- or download this
$ perl -I. harness.pl
...
Leacher::new() : found variable 'address_1' and adding it with the key
+ 'address_1'.
vars[1]=1222
vars[1]=666