#!usr/bin/perl use warnings; use strict; my $string = "\nThis-is:a\@test-for,*you."; $string = join( ',', split( /([-:@*])/, $string )); print "$string\n\n";