summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Config.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-02-01 08:48:07 +0000
committerfukachan <fukachan>2003-02-01 08:48:07 +0000
commit5a7d235eb5b544093178c1f2f9c1328c0824b28b (patch)
tree239cf3923c8371363aaf0cde9274dff957bdfd98 /fml/lib/FML/Config.pm
parentdbc5ec225cc7f7395b326d6e54ca9b0f1c2d1edb (diff)
downloadfml8-5a7d235eb5b544093178c1f2f9c1328c0824b28b.tar.gz
fml8-5a7d235eb5b544093178c1f2f9c1328c0824b28b.tar.bz2
fml8-5a7d235eb5b544093178c1f2f9c1328c0824b28b.zip
FNF: not use $_
Diffstat (limited to 'fml/lib/FML/Config.pm')
-rw-r--r--fml/lib/FML/Config.pm26
1 files changed, 13 insertions, 13 deletions
diff --git a/fml/lib/FML/Config.pm b/fml/lib/FML/Config.pm
index 054f2893..da9cb227 100644
--- a/fml/lib/FML/Config.pm
+++ b/fml/lib/FML/Config.pm
@@ -3,7 +3,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Config.pm,v 1.77 2003/01/11 06:58:44 fukachan Exp $
+# $FML: Config.pm,v 1.78 2003/01/28 05:33:33 fukachan Exp $
#
package FML::Config;
@@ -306,7 +306,7 @@ sub _read_file
if (defined $fh) {
my ($key, $value, $curkey, $comment_buffer);
- my ($after_cut, $hook);
+ my ($after_cut, $hook, $buf);
my $name_space = ''; # by default
# For example
@@ -318,36 +318,36 @@ sub _read_file
# [mysql:fml]
# var = key1 ...
#
- while (<$fh>) {
+ while ($buf = <$fh>) {
# Example: [mysql:fml]
# switched to the new name space.
- if (/^\[([\w\d\:]+)\]\s*$/o) {
+ if ($buf =~ /^\[([\w\d\:]+)\]\s*$/o) {
$name_space = "[$1]";
}
if ($after_cut) {
- $hook .= $_ unless /^=/o;
- $after_cut = 0 if /^=\w+/o;
+ $hook .= $buf unless $buf =~ /^=/o;
+ $after_cut = 0 if $buf =~ /^=\w+/o;
next;
}
- $after_cut = 1 if /^=cut/o; # end of postfix format
+ $after_cut = 1 if $buf =~ /^=cut/o; # end of postfix format
- if (/^=/o) { # ignore special keywords of pod formats
+ if ($buf =~ /^=/o) { # ignore special keywords of pod formats
$name_space = '';
next;
}
if ($mode eq 'raw') { # save comment buffer
- if (/^\s*\#/o) { $comment_buffer .= $_;}
+ if ($buf =~ /^\s*\#/o) { $comment_buffer .= $buf;}
}
else { # by default, nuke trailing "\n"
chomp;
}
# case 1. "key = value1"
- if (/^([A-Za-z0-9_]+)\s*(=)\s*(.*)/o ||
- /^([A-Za-z0-9_]+)\s*(\+=)\s*(.*)/o ||
- /^([A-Za-z0-9_]+)\s*(\-=)\s*(.*)/o) {
+ if ($buf =~ /^([A-Za-z0-9_]+)\s*(=)\s*(.*)/o ||
+ $buf =~ /^([A-Za-z0-9_]+)\s*(\+=)\s*(.*)/o ||
+ $buf =~ /^([A-Za-z0-9_]+)\s*(\-=)\s*(.*)/o) {
my ($key, $xmode, $value) = ($1, $2, $3);
$xmode =~ s/=//o;
$value =~ s/\s*$//o;
@@ -366,7 +366,7 @@ sub _read_file
}
}
# case 2. "^\s+value2"
- elsif (/^\s+(.*)/o && defined($curkey)) {
+ elsif ($buf =~ /^\s+(.*)/o && defined($curkey)) {
my $value = $1;
__append_config($config, $curkey, $value, $name_space);
}