我有一个文本文件
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = " "
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# also the default input encoding. Doxygen uses libiconv (or the iconv built
# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
# the list of possible encodings.
我必须在“”之间的 INPUT 行中输入路径名
我的代码
use strict;
use warnings;
open(FILE, "< abcd") or die $!;
open(FILE1, "> abcd1") or die $!;
my @lines = <FILE>;
my $i = $ARGV[0];
$lines[5] = "";
splice @lines,5,0, 'INPUT = "$i"';
print FILE1 @lines;
close(FILE);
输出为
INPUT = "$i"
但我希望输出是
INPUT = "abcd" #abcd is whatever is passed as arguments