Because
$VAR::phpmodules = ("php5-curl", "php5-mcrypt", "php-abc");
isn't doing what you think it is. It's assigning the last element in the list.
my $thing = ( "one", "two", "three" );
print $thing;
#prints "three";
However, this is a really good example why use strict; and use warnings; is a REALLY good idea - because warnings tells you:
Useless use of a constant ("one") in void context at line ...
Useless use of a constant ("two") in void context at line ...
Try:
$VAR::phpmodules = ["php5-curl", "php5-mcrypt", "php-abc"];
Which will turn it into an array-ref. (You'll have to dereference it to print it though, with print @$VAR::phpmodules )
my $thing = [ "one", "two", "three" ];
print @$thing;
#prints onetwothree because no delimiter between array elements.
Or
@VAR::phpmodules = ("php5-curl", "php5-mcrypt", "php-abc");
e.g.
my @thing = ( "one", "two", "three" );
print @thing;
#prints "onetwothree"
perl -cthat module, does it work?warningsturned on too, for perl to warn you about the bad syntax on that line.