in reply to Any way to call GetOptions with evaluated / interpoltated args ?

It sounds like an unusual way of doing things, so maybe you should explain the broader context for your question, but to answer it you'll notice that in GetOptions( 'arg1=s' => \$arg1); there are no quotes around the second argument. You shouldn't have quotes in your other attempts (ie, instead of sending a string, send a reference):

my @opt = ('arg1=s', \$arg1); my %opt = ('arg1=s' => \$arg1);

Replies are listed 'Best First'.
Re^2: Any way to call GetOptions with evaluated / interpoltated args ?
by jjmoka (Beadle) on Nov 26, 2018 at 16:43 UTC
    Thank you very much. It works. Here my minor reason to want that. I also know I was entering an unusual field (I would even accept to relax sometimes the 'use strict "refs"' to use symbolic references). My command line script is expected to dump a 'usage' message (with the list of options) and a GetOptions to load them. For my personal taste I didn't like to replicate the same list in the 'usage' message and in GetOptions. I wanted a single list of options and then I'm using that list to both create the message and to feed GetOptions. Thanks again.