#!/usr/bin/perl use warnings; use strict; use Test::More tests => 1; my $string = "/3212/2344,4334,XYZ&54,32/4333%3343%12"; my @array = do { no warnings 'qw'; qw(/ 3212 / 2344 , 4334 , XYZ & 54 , 32 / 4333 % 3343 % 12); }; my @ar = split m{([/&%,])}, $string; shift @ar if $string =~ m{^[/&%,]}; # Leading separators might cause problems. is_deeply(\@ar, \@array, 'ok');