Divide according to multiple separators.
#!usr/bin/perl use warnings; use strict; my $string = "\nThis-is:a\@test-for,*you."; my @words = split( /[-:@*]/, $string ); print "$_\n" foreach ( @words );