packetie
packetie

Reputation: 5069

This perl syntax is confusing

Perl Inline::C package has the following example,

use Inline C => config => inc => '-I/inc/path';

Wonder if the part

C => config => inc => '-I/inc/path'

is equivalent to

C => {config => {inc => "-I/inc/path"}}

Thanks.

Upvotes: 2

Views: 126

Answers (1)

Dave Cross
Dave Cross

Reputation: 69314

No, it's not the same. The => is a comma which auto-quotes the expression on its left. So your code is equivalent to:

use Inline 'C', 'config', 'inc', '-I/inc/path';

Upvotes: 1

Related Questions