in reply to Re^3: Using . in variable name
in thread Using . in variable name

Thank you for all the help again. Here's the code that invokes the script:

system("ant -file japi/test.xml -Dapp1.url=${app1.url} -Dapp2.url=${app2.url}");

Replies are listed 'Best First'.
Re^5: Using . in variable name
by hippo (Archbishop) on Apr 17, 2015 at 09:36 UTC

    You can call the variable anything. Let's say $dog or $cat in which case:

    my $dog = 'http://www.perl.org/'; my $cat = 'https://metacpan.org/'; system("ant -file japi/test.xml -Dapp1.url=$dog -Dapp2.url=$cat");

    Which is equivalent then to this command you would type at your prompt:

    ant -file japi/test.xml -Dapp1.url=http://www.perl.org/ -Dapp2.url=htt +ps://metacpan.org/

      shell is danger :) system 'ant', '--file', 'japi/test.xml', "-Dapp1.url=$dog", "-Dapp2.url=$cat";

Re^5: Using . in variable name
by Corion (Patriarch) on Apr 17, 2015 at 09:08 UTC

    Maybe you don't want to use a variable here but a hash with the appropriate keys?

    Or just change ${app1.url} to $app1_url if you feel uncomfortable with hashes?