It makes a difference because with the added quotes, you're splitting on a literal string rather than a regular expression.
If you want to split along tab characters, then the following are equivalent:
@data{@speciesList} = split /\t/, $_, scalar @speciesList;
@data{@speciesList} = split "\t", $_, scalar @speciesList;
But the following is not:
@data{@speciesList} = split "/\t/", $_, scalar @speciesList;
as that splits on a slash followed by a tab followed by another slash, rather than just a slash. Here's a quick demonstration that may be instructive:
#!/usr/bin/perl
use strict;
use warnings;
use feature qw/say/;
use English;
$LIST_SEPARATOR = ",";
while(<DATA>) {
chomp;
my @a = split /\t/;
my @b = split "\t";
my @c = split "/\t/";
say "@a";
say "@b";
say "@c";
}
__DATA__
foo bar
foo/ /bar
This outputs:
$ perl 1119187.pl
foo,bar
foo,bar
foo bar
foo/,/bar
foo/,/bar
foo,bar
$
EDIT: posting the above script converted tab characters to spaces in the __DATA__ section, so you'll have to change those back before running the script to get the correct output.
|