Help for this page

Select Code to Download


  1. or download this
    my $sep_re = quotemeta($sep);
    
    my @fields = split(/$sep_re/, $_);
    
  2. or download this
    my @fields = split(/\Q$sep/, $_);
    
  3. or download this
    $\ = "\n";
    $, = ";";
    ...
       print @fields;
       print '';
    }
    
  4. or download this
    a,b,c
    a;b;c
    ...
    
    a|b|c
    a;b;c
    
  5. or download this
    $\ = "\n";
    $, = ";";
    for my $sep ('\t', "\t") {
       print split(/\Q$sep/, "foo\tbar\\tbaz");
    }
    
  6. or download this
    foo     bar;baz
    foo;bar\tbaz