#!/usr/bin/perl -wT use strict; my $new_type = "BookInstructional MaterialTeaching Guide"; print "Before: $new_type\n"; $new_type =~ s/([a-z])([A-Z])/$1::$2/g; print "After: $new_type\n"; =OUTPUT Before: BookInstructional MaterialTeaching Guide After: Book::Instructional Material::Teaching Guide