#!/usr/bin/perl use strict; use warnings; my $var = q~ echo hi there echo lo there ~; $var =~ s/^\s+//gm; print $var;