$blah{one}=~s/a/b/g; $blah{two}=~s/a/b/g; #### s/a/b/g foreach @blah{'one', 'two'} ;