so make up a reference to an anonymous list as:The third parameter, the input parameter list, specifies how many arguments the function wants, and their types. It MUST be passed as a list reference. The following forms are valid: [a, b, c, d] \@LIST
The [] square brackets make an anonymous array so the scalar $arr (which you need to supply to the Call method of Win32::API) contains a reference to that array.my $arr = [ pack("d",1), pack("d",1.5), pack("d",3) ]; # or as I would do it... my $arr = [ map { pack 'd', $_ } ( 1, 1.5, 3 ) ];
You could as easily do:
and then pass a reference to the list (\@arr) - whichever you prefer.my @arr = map { pack 'd', $_ } ( 1, 1.5, 3 );
Hope this helps
larryk perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
In reply to Re: Calling win32:api dll with pointer to array
by larryk
in thread Calling win32:api dll with pointer to array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |