#!/usr/bin/perl -w use strict; print unindent(<<'END'); test test2 END print unindent(<<'END', "(?: {4}|\t)"); test test2 END print unindent(<<'END', ''); I don't want this text to be unindented. END