Skip to content

Commit

Permalink
print only when verbose
Browse files Browse the repository at this point in the history
svn path=/bioperl-live/trunk/; revision=11501
  • Loading branch information
sendu committed Jun 21, 2007
1 parent e9372e6 commit 4c4e9e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/root/lib/TestObject.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use base qw(Bio::Root::Root TestInterface);

sub data {
my ($self, $data) = @_;
print "Setting test data ($data)\n" if $data;
print "Setting test data ($data)\n" if $data && $self->verbose;
$self->{'data'} = $data if $data;

return $self->{'data'}
Expand All @@ -47,8 +47,8 @@ sub bar {

my $self = shift;

print "\nExecuting method bar() in TestObject\n";
print "Throwing a Bio::TestException\n";
print "\nExecuting method bar() in TestObject\n" if $self->verbose;
print "Throwing a Bio::TestException\n" if $self->verbose;

my $message = "A Test error";

Expand All @@ -60,7 +60,7 @@ sub bar {
$self->throw( -class => 'Bio::TestException',
-text => $message );

print "Code within bar() below the throw that shouldn't be executed.\n";
print "Code within bar() below the throw that shouldn't be executed.\n" if $self->verbose;

}

Expand Down

0 comments on commit 4c4e9e8

Please sign in to comment.