in reply to comma within array

Just use double quotes. Array elements are separated by spaces in double quotes by default (see $" in perlvar).
#!/usr/bin/perl use warnings; use strict; use Test::More tests => 1; my @array = do { no warnings 'qw'; qw(one two, three four five, six); }; is("@array", 'one two, three four five, six', 'same');

qw// warns about commas, so I turned off that particular warning category.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: comma within array
by theleftright (Novice) on Jan 05, 2016 at 21:24 UTC
    Hi, didnt think it would matter, but that array I showed was a sample array.. here is part of the real code:
    @arrayCode = qw( $cn=join(",",@names); print@names; ); $ac = join("",@arrayCode); eval($ac);
    this seems very strange to you, why the hell would i need to do this?! but unfortunately I do :D eval is unable to execute this code because of the comma :/
      You haven't shown the relevant part of the code. I can run it without problems, with your join and with my double quotes:
      #!/usr/bin/perl use warnings; use strict; my @names = qw( John Jane Jake ); my @arrayCode = do { no warnings 'qw'; qw( $cn=join(",",@names); print@names; ) }; for my $ac ( "@arrayCode", join q(), @arrayCode ) { my $cn; eval "$ac; 1" or die $@; print $cn, "\n"; }
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      The eval works fine for me.

      What is the point of this code??