分裂功能 [英] split function

查看:85
本文介绍了分裂功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是perl编程的新手。


我要求验证用户收到的输入文件并将其发送到打印机。


例如:

脚本-o选项-p printername -f文件名


脚本 - 是我的脚本的名称

-o选项 - 是必须用另一个文件验证的选项

-p printername - 是的名称我的打印机

-f filename - 是必须打印的文件名。


在这种情况下如何使用此拆分功能。我想采取 -o选项并将其与文件进行比较。

我已准备好打印队列。什么是将文件名发送到打印机的命令。


请帮助我。


谢谢。

Hi,

I am new to perl programming.

I have a requirement to validate the input received from the user with the file and send it to the printer.

For Eg:
script -o option -p printername -f filename

script - is the name of my script
-o option- is the option that has to be validated with another file
-p printername - is the name of my printer
-f filename - is the filename which has to be printed.

how to use this split function in this case. I want to take" -o option" and compare it with the file.
I already have a print queue ready. what is teh command to send the filename to the printer.

Please help me.

Thanks.

推荐答案

要处理命令行选项,您可以使用 GetOpt :: Std 模块。
To process command line options, you can make use of GetOpt::Std module that comes with default Perl installation.


我使用了以下命令来检查文件是否存在。 />
虽然文件存在于正确的路径中,但它会转到其他部分。


或者如果路径错误,它就不会死... .... />
请帮忙...
i had used the below command to check whether the file exists or not.
eventhough the file exists in proper path, it is going to else part.

or if the path is wrong, it is not dying....
Please help...
展开 | 选择 | Wrap | 行号



i使用以下命令检查文件是否存在。

尽管文件存在于正确的路径中,它将是另一部分。


或如果路径错误,它不会死亡....

请帮助...
i had used the below command to check whether the file exists or not.
eventhough the file exists in proper path, it is going to else part.

or if the path is wrong, it is not dying....
Please help...
展开 | 选择 | Wrap | 行号


这篇关于分裂功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆