ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/Verbose.pm
(Generate patch)

Comparing COMP/SCRAM/src/Utilities/Verbose.pm (file contents):
Revision 1.1 by williamc, Fri Apr 7 08:22:07 2000 UTC vs.
Revision 1.2 by williamc, Mon Aug 28 08:35:17 2000 UTC

# Line 0 | Line 1
1 + #
2 + # Verbose.pm
3 + #
4 + # Originally Written by Christopher Williams
5 + #
6 + # Description
7 + # -----------
8 + # Simple multi parsing functionality
9 + #
10 + # Interface
11 + # ---------
12 + # new()         : A new ActiveDoc object
13 + # verbose(string)       : Print string in verbosity mode
14 + # verbosity(0|1)        : verbosity off|on
15 +
16 + package Utilities::Verbose;
17 + require 5.004;
18 +
19 + sub new {
20 +        my $class=shift;
21 +        $self={};
22 +        bless $self, $class;
23 +        $self->verbose("New ".ref($self)." Created");
24 +        return $self;
25 + }
26 +
27 + sub verbosity {
28 +        my $self=shift;
29 +        if ( @_ ) {
30 +           $self->{verbose}=shift;
31 +        }
32 +        $self->{verbose};
33 +        
34 + }
35 +
36 + sub verbose {
37 +        my $self=shift;
38 +        my $string=shift;
39 +
40 +        if ( $self->{verbose} ) {
41 +          print ">".ref($self)."($self) : \n->".$string."\n";
42 +        }
43 + }
44 +
45 + sub error {
46 +        my $self=shift;
47 +        my $string=shift;
48 +
49 +        print $string."\n";
50 +        exit 1;
51 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines