简体   繁体   English

你如何使用 SOAP::Lite?

[英]How do you use SOAP::Lite?

I am very new to linux and perl and I am trying to use SOAP::Lite as an API for ffencoderd, a daemon to convert my videos in background. I am very new to linux and perl and I am trying to use SOAP::Lite as an API for ffencoderd, a daemon to convert my videos in background. I know I am probably doing something stupid but I read the documentation SOAP::Lite and is says to type use SOAP::Lite.我知道我可能在做一些愚蠢的事情,但我阅读了文档SOAP::Lite并说输入使用 SOAP::Lite。 I type into the terminal use SOAP::Lite and it says 'no command use'.我在终端中输入使用 SOAP::Lite 并显示“不使用命令”。 So I try perl use SOAP::Lite and it says no directory use...Can someone give me some clarity here lol, I feel pretty dumb right now...所以我尝试使用 perl 使用 SOAP::Lite 并且它说没有目录使用......有人可以在这里给我一些澄清,哈哈,我现在感觉很愚蠢......

Your problem seems to be that you don't know Perl, rather then that you don't know SOAP::Lite.您的问题似乎是您不知道 Perl,而不是您不知道 SOAP::Lite。 You might like to start with the Modern Perl book (in hard copy or a free ebook).您可能想从现代 Perl 书(硬拷贝或免费电子书)开始。

SOAP::Lite is a module, not an executable, so you don't run it directly from the command line. SOAP::Lite 是一个模块,而不是可执行文件,所以不要直接从命令行运行它。

use is part of the Perl language, not an executable, so again, you can't run it directly from the command line. use是 Perl 语言的一部分,不是可执行文件,所以同样,您不能直接从命令行运行它。

You could write a Perl one-liner that calls it您可以编写一个 Perl 单行代码来调用它

perl -MSOAP::Lite -E'your perl code here'

… but SOAP is sufficiently complicated that a one-liner almost certainly isn't what you are after. ……但是 SOAP 足够复杂,以至于几乎可以肯定,单行线不是您想要的。

You need to open a text file, put the standard Perl boilerplate at the top (a shebang line along with use strict; use warnings; ) and then write your program there (so you can save it).您需要打开一个文本文件,将标准 Perl 样板放在顶部(一个 shebang 行以及use strict; use warnings; ),然后在那里编写您的程序(这样您就可以保存它)。

#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;

then you can run the script you saved:然后你可以运行你保存的脚本:

perl path/to/your.pl

Going from not knowing anything about Perl (which is, I assume, your current situation) to using complex modules like SOAP::Lite is a pretty big leap.从对 Perl (我假设你目前的情况)一无所知到使用像 SOAP::Lite 这样的复杂模块是一个很大的飞跃。 I'd really recommend working your way up to it over a period of some months.我真的建议您在几个月的时间里努力做到这一点。

But if your requirement is more urgent, then my best advice would be to hire a Perl programmer.但如果您的要求更紧急,那么我最好的建议是聘请 Perl 程序员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM