Split up : Split « String « Perl






Split up

     



#!/usr/bin/perl
use strict;
use warnings;

my $csv = "one, two, three, four, five, six";
my @list = split ', ' , $csv;
print "@list";

   
    
    
    
    
  








Related examples in the same category

1.Split string into separate words, and then test to see if each word is the one we're looking for.
2.Split words
3.A simple word-count program.
4.Using split function to split a string
5.Split string with ','
6.Find a word after splitting a string
7.Keeping the separators by having them in parentheses.