- or download this
package Soldier;
use constant NAME => 0;
...
}
# similar methods for RANK and SERIAL
- or download this
package Password;
use Digest::MD5 qw(md5_base64); # based on an idea by jbontje
...
my $candidate = shift;
return ($self eq md5_base64($candidate));
}
- or download this
package WordMatch;
sub new {
...
print $wm->match("[hi] how are you?"), "\n";
print $wm->match("hi how are you?"), "\n";
- or download this
package ReadFile;
...
my $line = <$self>;
return $line;
}
- or download this
my $file = ReadFile->new("obself.pl");
print $file->read_record("package");
print $file->read_record();
- or download this
sub DESTROY {
my $self = shift;
close $self;
print "Closed!\n"; # just to prove that it's working
}
- or download this
package SubBrowser;
sub new {
...
my $self = shift;
return &$self;
}
- or download this
package Wrapper;
use vars '$AUTOLOAD';
...
# our new version
my $wm2 = Wrapper->new(WordMatch->new("Hello"));
print $wm2->match("[Hello] little girl"), "\n";