Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Perl 如何使用Email::Stuff的示例有哪些?_Perl_Email - Fatal编程技术网

Perl 如何使用Email::Stuff的示例有哪些?

Perl 如何使用Email::Stuff的示例有哪些?,perl,email,Perl,Email,我在网上读到并遇到了一些例子。所有示例都没有创建对象。他们就这样离开了: Email::Stuff->to('Simon Cozens<simon@somewhere.jp>') ->from('Santa@northpole.org') ->text_body("You've been a good boy this year. No coal for you.") ->attach_f

我在网上读到并遇到了一些例子。所有示例都没有创建对象。他们就这样离开了:

Email::Stuff->to('Simon Cozens<simon@somewhere.jp>')
            ->from('Santa@northpole.org')
            ->text_body("You've been a good boy this year. No coal for you.")
            ->attach_file('choochoo.gif')
            ->send;
Email::Stuff->to('Simon Cozens'))
->从('Santa@northpole.org')
->text_body(“今年你是个好孩子,没有煤了。”)
->附加文件('choocoo.gif')
->发送;

当我按照上述方法操作时,我在./test.pl第27行通过包“Email::Stuff”(也许你忘了加载“Email::Stuff”?)得到了错误
找不到object method“to”。
有人能举例说明如何使用Email::Stuff吗?

与所有Perl模块一样,你必须
使用它们

use Email::Stuff;

与所有Perl模块一样,您必须
使用它们

use Email::Stuff;

这就是我在./test.pl第27行通过包“Email::Stuff”(也许你忘了加载“Email::Stuff”?)得到的错误。“也许你忘了加载“Email::Stuff”?请发布最小的,复制症状的完整代码——我们可以运行的代码——包括
use
require
指令。(您的错误消息强烈表明您忘记了
使用Email::Stuff;
,尽管您在对David的回答的评论中有相反的断言。)这就是我在./test.pl第27行得到的错误,“找不到对象方法”通过包“Email::Stuff”(可能您忘记加载“Email::Stuff”)也许你忘了加载“Email::Stuff”?请发布复制你症状的最小完整代码——我们可以运行的代码——包括
use
require
指令。(您的错误消息强烈表明您忘记了
使用Email::Stuff;
,尽管您在对David答案的评论中提出了相反的主张。)您是否安装了模块?如果在@INC中找不到Email/Stuff.pm而不是找不到对象方法,则会出错。您是否安装了模块?如果在@INC中找不到Email/Stuff.pm而不是找不到对象方法,则会出错。