gjh has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Okay first of all I'm still a newbie with Perl.
I'm having a problem with Carp on ActivePerl 5.8.7/8 and
dual core or multiprocessor Win32 (2000/xp/2003) systems.
The following is a short reproducer.
The reference to @ARGV rather than @_ in 'main' is required for Getopt::Long::GetOptions.
Can I pass @ARGV ?, seems to work on a uniprocessor, Can I fool GetOptions to operate on @_, or can't we test this code :-?
Thanks for any advice
gjh
When executed, it gives:use Carp; my_main(@ARGV); sub my_main { my $first = shift @ARGV; carp "Rubbish\n"; exit; }
The code is written this way for unit testing, the real module starts with the line : main (@ARGV) unless caller();$ argv 1 Bizarre copy of ARRAY in sassign at C:/progfile/Perl-5.8.8/lib/Carp/He +avy.pm line 45.
The reference to @ARGV rather than @_ in 'main' is required for Getopt::Long::GetOptions.
Can I pass @ARGV ?, seems to work on a uniprocessor, Can I fool GetOptions to operate on @_, or can't we test this code :-?
Thanks for any advice
gjh
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: bizarre Carp
by xdg (Monsignor) on Mar 29, 2007 at 13:04 UTC | |
by grinder (Bishop) on Mar 29, 2007 at 15:05 UTC | |
Re: bizarre Carp
by grinder (Bishop) on Mar 29, 2007 at 13:01 UTC | |
Re: bizarre Carp
by ikegami (Patriarch) on Mar 29, 2007 at 14:28 UTC | |
Re: bizarre Carp
by runrig (Abbot) on May 09, 2012 at 22:53 UTC | |
Re: bizarre Carp
by jrl (Novice) on Nov 29, 2007 at 19:49 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
Back to
Seekers of Perl Wisdom