#!/usr/bin/perl -w use strict; $_= "This/is/a/test"; s<(\w+)/><$`$1\n>g; print $_,$/,$/; $_= "This/is/a/test"; s<(\w+)/>ge; print $_,$/;