#!/usr/bin/perl -w use strict; while ( ) { s/ angle brackets between element pairs / instead make square bracketed / print $_ . "\n"; } __DATA__ my data here further text not good as contains in angle brackets another possibility is one in here #### my data here further text not good as contains [this] in angle brackets another possibility is [more] [than] one [angle pairs] in here