in reply to Re: Re: Need a Help - calling C program from Perl
in thread Need a Help - calling C program from Perl

Think of "use" as a function call, with specialized first argument, which is a bareword representing a name, then followed by arbitrary parameters:

use Module ( $arg1, $arg2, ... );

So now, think of this:

use Inline C;

The first argument ("Inline") is special, so that's ok, but what about the second argument, "C"? It's a bareword. That should raise the flag at which point you say, "Oh, I need to quote it!"

use Inline 'C';

Ah, but why did it work when it was

use Inline C => ...;

you say? The answer is simple. It's the same reason why the first example below works, but not the second one:

use strict; foo( FOOBAR => 'baz' ); foo( FOOBAR, 'baz' );

Yep, the "key" is automatically stringified upon encountering "=>". So when you look at the Inline example, you can clearly see that that's using this stringification trick.

Just for the record, from perlop:

The => digraph is mostly just a synonym for the comma operator. It's useful for documenting arguments that come in pairs. As of release 5.001, it also forces any word to the left of it to be interpreted as a string.

P.S. - you really should reply to the post that you refer to in your node, otherwise the poster to whom you're replying to may not notice