#!/usr/bin/perl # Example of the "translate" operation, to replace # any example of "a", "b", or "c" with uppercase $breakfast = "ham,eggs,cereal,grits"; $breakfast =~ tr/[a-c]/[A-C]/; print "$breakfast\n"; # hAm,eggs,CereAl,grits # Look how translation is done character by character # not string by string $breakfast = "ham,eggs,cereal,grits"; $breakfast =~ tr/grits/bacon/; print "$breakfast\n"; # ham,ebbn,ceaeal,bacon