大家好我在perl上有简单的新手问题.我正在查看某人的perl代码,他有一些变量声明如下:
my $OutputFiles=[];
$OutputFiles =
[
{ FID => 789133, TAGE => "BRWSGF_05K", nfiles => 1, Suffix => 'jpg' },
{ FID => 789134, TAGE => "BRWSGF_W05K", nfiles => 1, Suffix => 'jpg' },
{ FID => 789135, TAGE => "BRWSGF_E05K", nfiles => 1, Suffix => 'jpg' },
];
Run Code Online (Sandbox Code Playgroud)
它似乎是某种哈希数组,但变量声明$OutputFiles不像数组那样,所以我很困惑.请让我知道$OutputFiles应该是什么变量,以及如何操纵这样的变量.我再次坦率地承认我是Perl新手.
我在一段相当简单的代码上遇到了一个奇怪的问题.代码的相关部分如下:
void foo(int32 in_sd_id, int32 out_sd_id)
{
int32 nsds; /* number of data sets in the file */
int32 nattr; /* number of global attributes in the file */
int32 attr_cnt; /* count of number of attribute */
int32 attr_index; /* attribute index */
int32 attr_type, attr_size; /* attribute type and size */
char attr_name[40];
ret = SDfileinfo(in_sd_id, &nsds, &nattr);
printf("nattr is %d\n", nattr);
/* test to see if num_datasets and num_global_attr can be retrieved from in_sd_id */
if (ret …Run Code Online (Sandbox Code Playgroud)