Re: glib-mkenums in glib 2



On Dec 26, 2012, at 11:48 AM, John Emmas <johne53 tiscali co uk> wrote:

> On 26 Dec 2012, at 19:20, John Ralls wrote:
> 
>> 
>> ARGV should be a hint: It means the same thing in perl as it does in C. It seems that glib-mkenums either isn't getting an @ARGV or it's somehow getting cleared before that line.
>> 
> 
> Thanks John.  I think the fact that ARGV[0] is involved might be significant.  From my hazy recollection, argv[0] is normally the path to the app that got launched (in this case, the path to perl.exe).  There's nothing particularly unusual about that path:-
> 
> E:\Program Files\Perl\bin\perl.exe
> 
> although it does contain a space.  I wonder if that's the issue??
> 
> 
> 
>> It's certainly not a perl version problem.
>> 
>> Try running the command from a cmd shell and see if you get the same error. If it works from the shell, then there's something about the way MSVS is launching perl that's causing the problem.
>> 
> 
> I'm ahead of you there!  I've already tried it from a command prompt but the result is the same....  :-(

That's good, actually. That takes MSVS out of the equation so you can focus on what's going on with perl.

In C, you're absolutely right that argv[0] is the program name. However perl does a $0 = shift; before passing control to your program, which moves the program name to $0 and removes it from @ARGV (in perl a variable name beginning with $ is a scalar and one beginning with @ is an array. The first element of the array @ARGV is $ARGV[0]). That means that $ARGV[0] should be "--template", but for some reason is being stripped.

If you run:

perl -e 'print(join("\n", @ARGV));' foo bar

you should get the output

foo
bar

Do you?

Regards,
John Ralls


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]