my $arguments = [ { 'name' => "process_exp",'desc' => "{BasePlugin.process_exp}",'type' => "regexp",'deft' => &get_default_process_exp(),'reqd' => "no" },{ 'name' => "assoc_images",'desc' => "{MP4Plugin.assoc_images}",'type' => "flag",'deft' => "",{ 'name' => "applet_Metadata",'desc' => "{MP4Plugin.applet_Metadata}",'deft' => "" },{ 'name' => "Metadata_fIElds",'desc' => "{MP4Plugin.Metadata_fIElds}",'type' => "string",'deft' => "Title,Artist,Genre" },{ 'name' => "file_rename_method",'desc' => "{BasePlugin.file_rename_method}",'type' => "enum",'deft' => &get_default_file_rename_method(),# by default rename imported files and assoc files using this enCoding 'List' => $BasePlugin::file_rename_method_List,'reqd' => "no" } ];解决方法 正如Bwmat所说,它是对一组哈希引用的引用.读
$man perlref
要么
$man perlreftut # this is a bit more straightforward
如果您想了解更多有关参考文献的信息.
顺便说一句,在Perl中,您可以这样做:
@array = ( 1,2 ); # declare an array$array_reference = \@array; # take the reference to that array$array_reference->[0] = 2; # overwrite 1st position of @array$numbers = [ 3,4 ]; # this is another valID array ref declaration. Note [ ] instead of ( )
哈希也会发生同样的事情.
顺便说一句,您可以这样做:
%hash = ( foo => 1,bar => 2 );$hash_reference = \%hash; $hash_reference->{foo} = 2;$langs = { perl => 'cool',PHP => 'ugly' }; # this is another valID hash ref declaration. Note { } instead of ( )
并且……是的,您可以取消引用这些引用.
%{ $hash_reference }
将被视为哈希,所以如果你想打印上面的$langs键,你可以这样做:
print $_,"\n" foreach ( keys %{ $langs } );
要取消引用数组引用,请使用@ {}而不是%{}.甚至sub也可以被解除引用.
sub foo{ print "hello world\n";}my %hash = ( call => \&foo );&{ $hash{call} }; # this allows you to call the sub foo总结
以上是内存溢出为你收集整理的数组 – 我不明白这个Perl语法,有没有人有任何想法?全部内容,希望文章能够帮你解决数组 – 我不明白这个Perl语法,有没有人有任何想法?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)