Matt Fenwick is true. When your array is in double quotation marks, Perl will put a value $"(by default it is a space, see man perlvar ) between the elements. You can simply put it outside the quotation marks:
print ('Array: ', @myArray);
If you want the elements to be separated, for example, with a comma, change the output field separator:
use English '-no_match_vars';
$OUTPUT_FIELD_SEPARATOR = ',';
print ('Array: ', @myArray);
source
share