我需要将变量值从 bat 文件传递给 perl 脚本 [英] I need to pass variable values form a bat file to a perl script
本文介绍了我需要将变量值从 bat 文件传递给 perl 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为 exp.bat 的 bat 文件,它运行 exp.pl 一个 perl 脚本.当我从命令提示符运行 bat 时,我需要将值传递给 perl scipt.这可能吗.TIA
I have a bat file named exp.bat that runs exp.pl a perl script. I need to pass the values to the perl scipt when i run bat from my command prompt.Is that possible.TIA
推荐答案
minimal .pl:
minimal .pl:
use strict;
use warnings;
print join "*", @ARGV;
最小的 .bat:
@perl exp.pl %*
使用/演示:
exp.bat a "b c" d
a*b c*d
这篇关于我需要将变量值从 bat 文件传递给 perl 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文