diff options
| author | fukachan <fukachan> | 2002-07-02 12:38:44 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-07-02 12:38:44 +0000 |
| commit | faf7964395aebea538320ed74c97aa8870d16de5 (patch) | |
| tree | 2d7f5fa74070649a4cf4f6a451049c5db41d5eea /fml | |
| parent | 4eca1f9cc8fa41413682ea970300e33d70a761df (diff) | |
| download | fml8-faf7964395aebea538320ed74c97aa8870d16de5.tar.gz fml8-faf7964395aebea538320ed74c97aa8870d16de5.tar.bz2 fml8-faf7964395aebea538320ed74c97aa8870d16de5.zip | |
clean up
Diffstat (limited to 'fml')
| -rw-r--r-- | fml/lib/FML/Config/Convert.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fml/lib/FML/Config/Convert.pm b/fml/lib/FML/Config/Convert.pm index f989e07c..14b23246 100644 --- a/fml/lib/FML/Config/Convert.pm +++ b/fml/lib/FML/Config/Convert.pm @@ -4,7 +4,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: Convert.pm,v 1.7 2002/05/24 06:36:02 fukachan Exp $ +# $FML: Convert.pm,v 1.8 2002/06/01 05:09:24 fukachan Exp $ # @@ -81,13 +81,14 @@ sub convert sub convert_file { my ($src, $dst, $config) = @_; + my $dst_tmp = $dst .".". $$; - use FileHandle; - my $in = new FileHandle $src; - my $out = new FileHandle "> $dst.$$"; + use FileHandle; + my $in = new FileHandle $src; + my $out = new FileHandle "> " . $dst_tmp; if (defined $in && defined $out) { - chmod 0644, "$dst.$$"; + chmod 0644, $dst_tmp; eval q{ convert($in, $out, $config);}; croak($@) if $@; @@ -95,7 +96,7 @@ sub convert_file $out->close(); $in->close(); - rename("$dst.$$", $dst) || croak("fail to rename $dst"); + rename($dst_tmp, $dst) || croak("fail to rename $dst"); } else { croak("fail to open $src") unless defined $in; @@ -107,7 +108,7 @@ sub convert_file # Descriptions: replace __variable__ with real value in $config # Arguments: STR($buf) HASH_REF($config) # Side Effects: buffer replacement -# Return Value: STR($buf) +# Return Value: STR($buf) HASH_REF($config) sub _replace { my ($buf, $config) = @_; |
