I have got this part from a Perl plugin. I don’t understand what it does. Is it an array of associative arrays? If so, then shouldn’t it be started with @? Can anyone shed some light on this issue?
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' => "",
'reqd' => "no" },
{ 'name' => "applet_metadata",
'desc' => "{MP4Plugin.applet_metadata}",
'type' => "flag",
'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"
} ];
As Bwmat said it’s a reference to an Array of Hash references. Read
or
for if you want to know more about references.
By the way in fiew words in Perl you can do:
the same thing happens with hashes.
By the way in fiew words in Perl you can do:
And… yes, you can dereference these references.
will be treated as it was a hash, so if you want to print the keys of
$langsabove, you can do:To dereference an array ref use
@{ }instead of%{ }. Evensubcan be dereferenced.