use XML::LibXML;
use XML::XPath;
use XML::XPath::XMLParser;
print "Enter the file location for devices.xml file"."\n";
my $firstfile =<STDIN>;
my $filename = chomp($firstfile);
print "Enter the file location for discoveryinstances.xml file"."\n";
my $secondfile =<STDIN>; my $filename1=chomp($secondfile);
如何从用户命令提示符查询Perl中的文件位置?
答案 0 :(得分:2)
perldoc -f chomp - chomp
的返回值无用:它返回从字符串返回的字符数。参数被修改,所以你可以做
print "Enter the location:\n";
chomp( my $filename = <STDIN> );
...