replaces sed for perl