What does “$x->Put” do in Perl?

风流意气都作罢 提交于 2019-12-31 07:46:06

问题


I am looking at this piece of code:

$diag_cmd = pack("CCSV", DIAG_SUBSYS_CMD_F, DIAG_SUBSYS_PWRDB, PWRDB_DIAG_PKT_SCRIPT | $processor_select, length($s_part)) . $s_part;

     $diag_request_var = Variant(VT_ARRAY | VT_UI1, length $diag_cmd);
  $diag_request_var->Put($diag_cmd);

where Variant is defined below:

sub Variant {
    return Win32::OLE::Variant->new(@_);
}

I am not sure what does it do and what does PUT actually do in Perl.

Any ideas?


回答1:


Put is not a standard function that comes with Perl.

In this case, you have an object named $diag_request_var which is of class Win32::OLE::Variant. Put is a method of this object.

To know the standard functions that come with Perl, please see: perldoc perlfunc

Reference

Put(DIM, VALUE)



来源:https://stackoverflow.com/questions/21395336/what-does-x-put-do-in-perl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!