Parent Directory | Revision Log
move shared (between processes) configuration files into own package
1 | dpavlin | 74 | package config; |
2 | |||
3 | use warnings; | ||
4 | use strict; | ||
5 | |||
6 | use server; | ||
7 | use File::Slurp; | ||
8 | |||
9 | sub shared { | ||
10 | my ($name, $value) = @_; | ||
11 | |||
12 | my $path ="$server::base_dir/conf/$server::ip/$name"; | ||
13 | if ( defined $value ) { | ||
14 | write_file $path, $value; | ||
15 | } else { | ||
16 | $value = read_file $path if -e $path; | ||
17 | } | ||
18 | return $value; | ||
19 | } | ||
20 | |||
21 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |