perl -lpe "}{${'~'^'!'}=$." file