push @data, [ $_ ]; That isn't equivalent and won't work for the OP's purpose. You still need to split the string on commas.