/[VRac]/Prefs.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /Prefs.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 124 - (show annotations)
Sat Aug 4 14:13:28 2007 UTC (16 years, 7 months ago) by dpavlin
File size: 697 byte(s)
re-organize file patch to new VRac layout to ease re-use of code
1 package Prefs;
2
3 # Dobrica Pavlinusic, <dpavlin@rot13.org> 07/31/07 16:31:41 CEST
4
5 use strict;
6 use warnings;
7
8 use Carp qw/cluck/;
9 use Data::Dump qw/dump/;
10
11 use base qw(Class::Accessor);
12 # Screen
13 my @names = qw(scale show_mem);
14 # Orao
15 push @names, qw(debug trace);
16 warn "# Prefs names defined: ",join(",",@names),"\n";
17 __PACKAGE__->mk_accessors(@names);
18
19 =head1 Preferences
20
21 =head2 names
22
23 @names = Prefs->names;
24
25 =cut
26
27 sub names { return @names };
28
29 =head2 prefs;
30
31 print prefs( Prefs->dump );
32
33 =cut
34
35 sub prefs {
36 my $self = shift || die "no self?";
37 my $prefs;
38 foreach my $p ( @names ) {
39 $prefs->{$p} = $self->$p;
40 }
41
42 warn "## prefs = ",dump( $prefs ) if $self->debug;
43 return $prefs;
44 }
45
46
47 1;

  ViewVC Help
Powered by ViewVC 1.1.26