#!/usr/bin/perl use Data::Dumper; my %hash = ( b => bell, c => cell, d => dell, f => fell, h => hell ); foreach ( values %hash ) { s/ell/it/g }; print Dumper( \%hash ); my @array = qw ( b bell c cell d dell f fell h hell ); foreach ( @array ) { s/ell/it/g }; print Dumper ( \@array );