Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Undefined subroutine &Getopt::Long::GetOptionsFromArray?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Victor Hooi  
View profile  
 More options Aug 7 2012, 7:39 pm
From: Victor Hooi <victorh...@gmail.com>
Date: Tue, 7 Aug 2012 16:39:07 -0700 (PDT)
Local: Tues, Aug 7 2012 7:39 pm
Subject: Undefined subroutine &Getopt::Long::GetOptionsFromArray?

Hi,

I just pulled ack2 from Git, then compiled it on a OSX host.

I then moved ack-standalone to a Redhat EL 5.3 host, and tried to run it.
Perl is version 5.8.8 here:

$ perl --version

> This is perl, v5.8.8 built for x86_64-linux-thread-multi
> Copyright 1987-2006, Larry Wall
> Perl may be copied only under the terms of either the Artistic License or
> the
> GNU General Public License, which may be found in the Perl 5 source kit.
> Complete documentation for Perl, including FAQ lists, should be found on
> this system using "man perl" or "perldoc perl".  If you have access to the
> Internet, point your browser at http://www.perl.org/, the Perl Home Page.

It gave the error message:

Undefined subroutine &Getopt::Long::GetOptionsFromArray called at

> /home/<username>/ack-standalone line 3536.

I've pasted the lines around there in case it helps:

3507 sub remove_default_options_if_needed {$
3508     my ( $sources ) = @_;$
3509 $
3510     my $default_index;$
3511 $
3512     foreach my $index ( 0 .. $#$sources ) {$
3513         if ( $sources->[$index] eq 'Defaults' ) {$
3514             $default_index = $index;$
3515             last;$
3516         }$
3517     }$
3518 $
3519     return $sources unless defined $default_index;$
3520 $
3521     my $should_remove = 0;$
3522 $
3523     Getopt::Long::Configure('default'); # start with default options$
3524     Getopt::Long::Configure($
3525         'no_ignore_case',$
3526         'no_auto_abbrev',$
3527         'pass_through',$
3528     );$
3529 $
3530     foreach my $index ( $default_index + 2 .. $#$sources ) {$
3531         next if $index % 2 != 0;$
3532 $
3533         my ( $name, $args ) = @{$sources}[ $index, $index + 1 ];$
3534 $
3535         if(ref($args)) {$
3536             Getopt::Long::GetOptionsFromArray($args,$
3537                 'ignore-ack-defaults' => \$should_remove,$
3538             );$
3539         } else {$
3540             ( undef, $sources->[$index + 1] ) =
Getopt::Long::GetOptionsFromString($args,$
3541                 'ignore-ack-defaults' => \$should_remove,$
3542             );$
3543         }$
3544     }$
3545 $
3546     Getopt::Long::Configure('default');$
3547 $

I thought ack standalone was meant to include everything it needed? Or is
it using Getopt::Long from my system here? (I'm not too familiar with Perl,
to be honest). Any way to package this required module with Ack? Or way
around this?

Cheers,
Victor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Lester  
View profile  
 More options Aug 7 2012, 9:58 pm
From: Andy Lester <a...@petdance.com>
Date: Tue, 7 Aug 2012 20:58:09 -0500
Local: Tues, Aug 7 2012 9:58 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

On Aug 7, 2012, at 6:39 PM, Victor Hooi <victorh...@gmail.com> wrote:

> I thought ack standalone was meant to include everything it needed? Or is it using Getopt::Long from my system here? (I'm not too familiar with Perl, to be honest). Any way to package this required module with Ack? Or way around this?

ack-standalone contains all the non-core Perl modules.  The only non-core Perl module that ack uses is File::Next, and that gets folded into ack-standalone.

What I think the problem is is that you don't have a new enough version of Getopt::Long.  ack needs 2.36, and I'm guessing yours is older.  Do this to verify:

    perldoc -m Getopt::Long | grep '$VERSION'

Currently, the only version check on Getopt::Long is a build-time check in Makefile.PL.  We need runtime checks.  I'm adding a task for this.  https://github.com/petdance/ack2/issues/143

xoa

--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Victor Hooi  
View profile  
 More options Aug 8 2012, 12:10 am
From: Victor Hooi <victorh...@gmail.com>
Date: Tue, 7 Aug 2012 21:10:04 -0700 (PDT)
Local: Wed, Aug 8 2012 12:10 am
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

Hi,

I just rang that - I have version 2.35 =(:

$ perldoc -m Getopt::Long | grep '$VERSION'

> use vars qw($VERSION);
> $VERSION        =  2.35;
> #use vars qw($VERSION_STRING);
> #$VERSION_STRING = "2.35";
> ($major_version, $minor_version) = $VERSION =~ /^(\d+)\.(\d+)/;
>                  ? $Getopt::Long::VERSION_STRING : $VERSION, ";",

Is there any way to package it into the standalone version? Or otherwise
get this to work, short of having root rights on the box? (Unlikely...lol).

Cheers,
Victor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Lester  
View profile  
 More options Aug 8 2012, 12:14 am
From: Andy Lester <a...@petdance.com>
Date: Tue, 7 Aug 2012 23:14:37 -0500
Local: Wed, Aug 8 2012 12:14 am
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

On Aug 7, 2012, at 11:10 PM, Victor Hooi <victorh...@gmail.com> wrote:

> Is there any way to package it into the standalone version? Or otherwise get this to work, short of having root rights on the box? (Unlikely...lol).

I don't have an easy way to do it, no.  I definitely don't want to add Getopt::Long to what gets distributed in ack-standalone.  The Perl you're running against is a pretty old one.  Sorry.

xoa

--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher J. Madsen  
View profile  
 More options Aug 8 2012, 3:17 pm
From: "Christopher J. Madsen" <p...@cjmweb.net>
Date: Wed, 08 Aug 2012 14:17:54 -0500
Local: Wed, Aug 8 2012 3:17 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?
On 8/7/2012 11:10 PM, Victor Hooi wrote:

> Is there any way to package it into the standalone version? Or otherwise
> get this to work, short of having root rights on the box? (Unlikely...lol).

You don't need root access to install modules for your own use.  One
solution is to use local::lib:

  http://stackoverflow.com/q/2980297/8355
  http://search.cpan.org/perldoc?local%3A%3Alib

--
Chris Madsen                                          p...@cjmweb.net
  --------------------  http://www.cjmweb.net  --------------------


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Lester  
View profile  
 More options Aug 8 2012, 3:23 pm
From: Andy Lester <a...@petdance.com>
Date: Wed, 8 Aug 2012 14:23:58 -0500
Local: Wed, Aug 8 2012 3:23 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

On Aug 8, 2012, at 2:17 PM, Christopher J. Madsen wrote:

> You don't need root access to install modules for your own use.  One
> solution is to use local::lib:

>  http://stackoverflow.com/q/2980297/8355
>  http://search.cpan.org/perldoc?local%3A%3Alib

What would he have to do to ack-standalone to make it use the locally installed modules?  Just add a "use local::lib;" at the top?

xoa

--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher J. Madsen  
View profile  
 More options Aug 8 2012, 3:31 pm
From: "Christopher J. Madsen" <p...@cjmweb.net>
Date: Wed, 08 Aug 2012 14:31:23 -0500
Local: Wed, Aug 8 2012 3:31 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?
On 8/8/2012 2:23 PM, Andy Lester wrote:

> On Aug 8, 2012, at 2:17 PM, Christopher J. Madsen wrote:
>> You don't need root access to install modules for your own use.  One
>> solution is to use local::lib:

>>  http://stackoverflow.com/q/2980297/8355
>>  http://search.cpan.org/perldoc?local%3A%3Alib

> What would he have to do to ack-standalone to make it use the locally installed modules?  Just add a "use local::lib;" at the top?

The normal way of using local::lib is to have it set PERL5LIB so that
Perl uses local::lib-installed modules automatically.  You don't need to
make any change to ack-standalone in that case.  The Stack Overflow
answer includes the steps to do that both for your current shell session
and for future sessions.

If you don't set PERL5LIB, then adding "use local::lib;" at the top of
ack-standalone would work (assuming you used the default path for your
local::lib directory).

--
Chris Madsen                                          p...@cjmweb.net
  --------------------  http://www.cjmweb.net  --------------------


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Lester  
View profile  
 More options Aug 8 2012, 3:32 pm
From: Andy Lester <a...@petdance.com>
Date: Wed, 8 Aug 2012 14:32:57 -0500
Local: Wed, Aug 8 2012 3:32 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

On Aug 8, 2012, at 2:31 PM, Christopher J. Madsen wrote:

> The normal way of using local::lib is to have it set PERL5LIB so that
> Perl uses local::lib-installed modules automatically.  You don't need to
> make any change to ack-standalone in that case.  The Stack Overflow
> answer includes the steps to do that both for your current shell session
> and for future sessions.

> If you don't set PERL5LIB, then adding "use local::lib;" at the top of
> ack-standalone would work (assuming you used the default path for your
> local::lib directory).

Thanks for this. I'm thinking it ought to go in the docs somewhere.

xoa

--
Andy Lester => a...@petdance.com => www.petdance.com => AIM:petdance


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Victor Hooi  
View profile  
 More options Aug 8 2012, 7:00 pm
From: Victor Hooi <victorh...@gmail.com>
Date: Wed, 8 Aug 2012 16:00:38 -0700 (PDT)
Local: Wed, Aug 8 2012 7:00 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

heya,

Cool, that sounds like it might work =).

One thing that complicates things somewhat - the box in question doesn't
have direct internet access.

We have other boxes that have internet access, and we can SCP stuff across
to that box.

Is there still a way to bootstrap and setup Local::Lib and Getopt::Long?

Cheers,
Victor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher J. Madsen  
View profile  
 More options Aug 8 2012, 7:23 pm
From: "Christopher J. Madsen" <p...@cjmweb.net>
Date: Wed, 08 Aug 2012 18:23:39 -0500
Local: Wed, Aug 8 2012 7:23 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?
On 8/8/2012 6:00 PM, Victor Hooi wrote:

> One thing that complicates things somewhat - the box in question doesn't
> have direct internet access.
> Is there still a way to bootstrap and setup Local::Lib and Getopt::Long?

Of course, it's just more complicated.  cpanm and local::lib don't do
anything you can't do manually.  If you only want to install one module,
it's probably easier to do it by hand.

Get http://cpan.metacpan.org/authors/id/J/JV/JV/Getopt-Long-2.38.tar.gz

  tar xzf Getopt-Long-2.38.tar.gz
  cd Getopt-Long-2.38
  perl Makefile.PL INSTALL_BASE=/some/dir
  make test
  make install
  export PERL5LIB=/some/dir/lib/perl5

You'll need to set PERL5LIB in your profile to make it persistent.

If you want to install a number of modules, you should look at setting
up a local CPAN mirror: http://stackoverflow.com/q/11224325/8355

--
Chris Madsen                                          p...@cjmweb.net
  --------------------  http://www.cjmweb.net  --------------------


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Victor Hooi  
View profile  
 More options Aug 8 2012, 10:17 pm
From: Victor Hooi <victorh...@gmail.com>
Date: Wed, 8 Aug 2012 19:17:40 -0700 (PDT)
Local: Wed, Aug 8 2012 10:17 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

heya,

Cool, thanks for the tip. tl:dr version - I managed to install, but ack2
not picking it up - see below:

Hmm, using INSTALL_BASE didn't work, I got:

$ perl Makefile.PL INSTALL_BASE=/home/<username>/perl_modules

> Checking if your kit is complete...
> Looks good
> 'INSTALL_BASE' is not a known MakeMaker parameter name.
> Writing Makefile for Getopt::Long

However, using PREFIX did work, and it installed correctly:

$ make install

> Manifying blib/man3/Getopt::Long.3pm
> Installing /home/<username>/perl_modules/lib/perl5/5.8.8/newgetopt.pl
> Installing /home/<username>/perl_modules/lib/perl5/5.8.8/Getopt/Long.pm
> Installing /home/v<username>/perl_modules/share/man/man3/Getopt::Long.3pm
> Writing
> /home/<username>/perl_modules/lib64/perl5/5.8.8/x86_64-linux-thread-multi/a uto/Getopt/Long/.packlist
> Appending installation info to
> /home/<username>/perl_modules/lib64/perl5/5.8.8/x86_64-linux-thread-multi/p erllocal.pod

I then exported PERL5LIB:

$ export PERL5LIB=/home/<username>/perl_modules

However, ack2 still doesn't seem to see that.

Undefined subroutine &Getopt::Long::GetOptionsFromArray called at

> /home/<username>/ack-standalone2 line 3536.

I ran perl -V to double-check - seems to have recognised that new directory:

$ perl -V

I thought of specifiying a deeper directory for PERL5LIB:

$ export

> PERL5LIB=/home/<username>/perl_modules/lib64/perl5/5.8.8/x86_64-linux-threa d-multi

I still get the Undefined Subroutine error - any ideas?

Cheers,
Victor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher J. Madsen  
View profile  
 More options Aug 8 2012, 10:23 pm
From: "Christopher J. Madsen" <p...@cjmweb.net>
Date: Wed, 08 Aug 2012 21:23:37 -0500
Local: Wed, Aug 8 2012 10:23 pm
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?
On 8/8/2012 9:17 PM, Victor Hooi wrote:

> Hmm, using INSTALL_BASE didn't work, I got:

I forgot you've got an old MakeMaker, too.

> However, using PREFIX did work, and it installed correctly:

PREFIX works differently.  With that, you need to

  export
PERL5LIB=/home/<username>/perl_modules/lib64/perl5/5.8.8/x86_64-linux-threa d-multi:/home/<username>/perl_modules/lib/perl5/5.8.8

(that should be all 1 long line with no spaces)

--
Chris Madsen                                          p...@cjmweb.net
  --------------------  http://www.cjmweb.net  --------------------


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Victor Hooi  
View profile  
 More options Aug 10 2012, 3:12 am
From: Victor Hooi <victorh...@gmail.com>
Date: Fri, 10 Aug 2012 00:12:44 -0700 (PDT)
Local: Fri, Aug 10 2012 3:12 am
Subject: Re: [ack-users] Undefined subroutine &Getopt::Long::GetOptionsFromArray?

heya,

I can verify this all works now =).

Cheers,
Victor


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »