- or download this
use strict;
...
my $hash_ref = shift;
return $hash_ref->{approved};
}
- or download this
package Quote;
...
}
1;
- or download this
use strict;
use Quote;
...
print STDOUT (Quote::is_approved() ? "Is approved" : "Is not approved"
+), "\n";
exit 0;
- or download this
Foo
Bar
Is approved
- or download this
package Quote;
...
}
1;
- or download this
use strict;
use Quote;
...
print STDOUT ($quote->is_approved() ? "Is approved" : "Is not approved
+"), "\n";
exit 0;
- or download this
Baz
Foo
Is not approved
- or download this
sub new {
my $class = shift;
...
print STDOUT "Object ", $self, " is of class ", ref($self), "\
+n";
return $self;
}
- or download this
HASH
Object Quote=HASH(0x804b514) is of class Quote
Baz
Foo
Is not approved
- or download this
sub set_phrase {
my $self = shift;
...
my $phrase = shift;
$self->{phrase} = $phrase;
}
- or download this
Object Quote=HASH(0x804b514) is of class Quote
- or download this
use strict;
use Quote;
...
print STDOUT $quote2->get_author(), " wrote ", $quote2->get_phrase(),
+"\n";
exit 0;
- or download this
Some other author wrote Baz
Foo wrote Some other phrase
- or download this
sub set_phrase {
my $self = shift;
...
my $self = shift;
return $self->{invalid_message};
}
- or download this
sub set_phrase {
my $self = shift;
...
}
$self->{author} = $author;
}
- or download this
package Saver;
...
1;
- or download this
use strict;
use Quote;
...
print STDOUT "Exiting\n";
exit 0;
- or download this
Exiting
Closing file
- or download this
sub serialize {
my $self = shift;
...
$text .= $quote->get_phrase();
return $text;
}
- or download this
sub save {
my $self = shift;
...
}
print {$self->{fh}} $self->serialize($quote) . "\n";
}
- or download this
$saver->save($quote2);
$saver->save($quote1);
- or download this
package Saver::Database;
...
&_close();
return;
}
- or download this
my $saver = Saver::File->new($file);
- or download this
my $saver = Saver::Database->new($db, $user, $pass);
- or download this
sub phrase {
my $self = shift;
@_ ? $self->{phrase} = shift : $self->{phrase};
}
- or download this
$quote->Set(phrase=>$phrase,author=>$author);
- or download this
eval {
$object->method($foo)
...
if (@$) {
... handle error ...
}